Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Teleportation by image


iHero
 Share

Recommended Posts

**Beginning**

Data files in the folder \ graphics \ create a new folder called images and inside add a second photo with name "1", "2" without quotes

**Client~Side**

In frmMain create picture box with two settings:

> Picture1
>
> Name: picTele1
>
> Picture2
>
> Name: picTele2

Within the picTele1 add:

```
    Call SendTele1
```
And within the Tele2 add pic

```
    Call SendTele2
```
And now the end of modClientTcp add:

```
Public Sub SendTele1()
    Dim Buffer As clsBuffer
    Set Buffer = New clsBuffer

    Buffer.WriteLong CTele1

    SendData Buffer.ToArray()
    Set Buffer = Nothing
End Sub

Public Sub SendTele2()
    Dim Buffer As clsBuffer
    Set Buffer = New clsBuffer

    Buffer.WriteLong CTele2

    SendData Buffer.ToArray()
    Set Buffer = Nothing
End Sub
```
In modEnumerations find:

```
    ' Make sure CMSG_COUNT is below everything else
    CMSG_COUNT
```

And add on top:

```
    CTele1
    CTele2
```
Now look for:

```
    ' Make sure SMSG_COUNT is below everything else
    SMSG_COUNT
```
And add up:

```
    SImages
```
Look for:

```
    HandleDataSub(SPartyVitals) = GetAddress(AddressOf HandlePartyVitals)
```
And add below:

```
    HandleDataSub(SImages) = GetAddress(AddressOf HandleImages)
```
Now at the end of modHandleData add:

```
Private Sub HandleImages(ByVal Index As Long, ByRef Data() As Byte, ByVal EditorIndex As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
    Dim Buffer As clsBuffer

    If GetPlayerClass(Index) = 1 Then
        frmMain.picTele1.Picture = LoadPicture(App.Path & "\data files\graphics\images\1.jpg")
        frmMain.picTele2.Picture = LoadPicture(App.Path & "\data files\graphics\images\2.jpg")
    ElseIf GetPlayerClass(Index) = 2 Then
        'Here is if you want more pro classes
    End If

    Set Buffer = Nothing
End Sub
```
**Serve~Side**

Look for:

```
    HandleDataSub(CPartyLeave) = GetAddress(AddressOf HandlePartyLeave)
```
And add below:

```
    HandleDataSub(CTele1) = GetAddress(AddressOf HandleTele1)
    HandleDataSub(CTele2) = GetAddress(AddressOf HandleTele2)
```
At the end of modHandleData add:

```
Sub HandleTele1(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim Buffer As clsBuffer

    If GetPlayerLevel(Index) >= 10 Then
        Call PlayerWarp(Index, 1, 2, 3)
    End If

    Set Buffer = Nothing
End Sub

Sub HandleTele2(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim Buffer As clsBuffer

    If GetPlayerLevel(Index) >= 10 Then
        Call PlayerWarp(Index, 1, 2, 3)
    End If

    Set Buffer = Nothing
End Sub
```
In modEnumerations find:

```
    ' Make sure CMSG_COUNT is below everything else
    CMSG_COUNT
```
And add on top:

```
    CTele1
    CTele2
```
Now look for:

```
    ' Make sure SMSG_COUNT is below everything else
    SMSG_COUNT
```
And add up:

```
    SImages
```
At the end of modServeTcp add:

```
Sub SendImages(ByVal Index As Long)
Dim Buffer As clsBuffer

    Set Buffer = New clsBuffer
    Buffer.WriteLong SImages

    SendDataToMap GetPlayerMap(Index), Buffer.ToArray()
    Set Buffer = Nothing
End Sub
```
Look for:

```
    Call SendHotbar(Index)
```
And add below:

```
    Call SendImages(Index)
```
Credits:

iHero
Link to comment
Share on other sites

  • 3 months later...
Hey I was wondering if you know how to make the pic use an item instead of teleport? im trying to make it so  i dont have to have recipe items in my inventory and i would much rather just add a crafting frame with picures that call use item. so far i havent been able to figure it out. if ya could point me in the right direction i would be very grateful.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...