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

Pet System script (No Longer Beign Worked On)


Dennys
 Share

Recommended Posts

  • Replies 417
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

YOU DO??? lol i was thinking modifying this code:

```
If LCase(Mid(TextSay, 1, 6)) = "/spawn" Then
Count = 0
q = 8
a = 11
If Len(Textsay) < 28 Then
Exit Sub
End If

Do While q <= Len(TextSay)
Select Case Count

Case 0
If LCase(Mid(TextSay, Int(q), 1)) = " " Then
NPC = Int(Mid(TextSay, a, Int(q) - a))
Count = Count + 1
a = q + 5
End If

Case 1
If LCase(Mid(TextSay, Int(q), 1)) = " " Then
Slot = Int(Mid(TextSay, a, Int(q) - a))
Count = Count + 1
a = q + 4
End If

Case 2
If LCase(Mid(TextSay, Int(q), 1)) = " " Then
Map = Int(Mid(TextSay, a, Int(q) - a))
Count = Count + 1
a = q + 2
End If

Case 3
If LCase(Mid(TextSay, Int(q), 1)) = " " Then
X = Int(Mid(TextSay, a, Int(q) - a))
Count = Count + 1
a = q + 2
End If

Case 4
If q = Len(TextSay) Then
Y = Int(Mid(TextSay, a, Int(q) - a + 1))
End If

End Select

q = q +1
Loop

Call ScriptSpawnNPC(Int(NPC), Int(Map), Int(X), Int(Y), Int(Slot))

Exit Sub
End If
```
modify it to the pet thing… you think it will work?
Link to comment
Share on other sites

Alright im prety sure these 2 Commands Work, POut them in ClsCommands On server:
~~W8 NVM~~
```
Sub ScriptRemovePet(ByVal MapPetNum As Long, ByVal MapNum As Long)
    ' NPC_index              map_number          X spawn          Y spawn            NPC_number
    Dim packet As String
    Dim I As Long

    ' Check for subscript out of range
    If MapPetNum < 0 Or MapPetNum > MAX_MAP_PETS Or MapNum <= 0 Or MapNum > MAX_MAPS Then
        Exit Sub
    End If

    Map(MapNum).Revision = Map(MapNum).Revision + 1
    MapPET(MapNum, MapPetNum).num = 0
    Map(MapNum).NPC(MapPetNum) = 0
    MapPET(MapNum, MapPetNum).Target = 0
    MapPET(MapNum, MapPetNum).HP = 0
    MapPET(MapNum, MapPetNum).MP = 0
    MapPET(MapNum, MapPetNum).SP = 0
    MapPET(MapNum, MapPetNum).Dir = 0
    MapPET(MapNum, MapPetNum).X = 0
    MapPET(MapNum, MapPetNum).Y = 0
    packet = "SPAWNPET" & SEP_CHAR & MapPetNum & SEP_CHAR & MapPET(MapNum, MapPetNum).num & SEP_CHAR & MapPET(MapNum, MapPetNum).X & SEP_CHAR & MapPET(MapNum, MapPetNum).Y & SEP_CHAR & MapPET(MapNum, MapPetNum).Dir & SEP_CHAR & PETS(MapPET(MapNum, MapPetNum).num).Big & END_CHAR
    Call SendDataToMap(MapNum, packet)
    Call SaveMap(MapNum)
    For I = 1 To MAX_PLAYERS
        If IsPlaying(I) And GetPlayerMap(I) = MapNum Then
            Call SendDataTo(I, "CHECKFORMAP" & SEP_CHAR & GetPlayerMap(I) & SEP_CHAR & Map(GetPlayerMap(I)).Revision & END_CHAR)
        End If
    Next I

End Sub
Sub ScriptSpawnPet(ByVal MapPetNum As Long, ByVal MapNum As Long, ByVal spawn_X As Long, ByVal spawn_Y As Long, ByVal PETnum As Long)
    ' NPC_index              map_number          X spawn          Y spawn            NPC_number
    Dim packet As String
    Dim I As Long

    ' Check for subscript out of range
    If MapPetNum < 0 Or MapPetNum > MAX_MAP_PETS Or MapNum <= 0 Or MapNum > MAX_MAPS Then
        Exit Sub
    End If

    If PETnum = 0 Then
        Map(MapNum).Revision = Map(MapNum).Revision + 1
        MapPET(MapNum, MapPetNum).num = 0
        Map(MapNum).NPC(MapPetNum) = 0
        MapPET(MapNum, MapPetNum).Target = 0
        MapPET(MapNum, MapPetNum).HP = 0
        MapPET(MapNum, MapPetNum).MP = 0
        MapPET(MapNum, MapPetNum).SP = 0
        MapPET(MapNum, MapPetNum).Dir = 0
        MapPET(MapNum, MapPetNum).X = 0
        MapPET(MapNum, MapPetNum).Y = 0

        ' Packet = "SPAWNNPC" & SEP_CHAR & MapNpcNum & SEP_CHAR & MapNpc(mapnum, MapNpcNum).num & SEP_CHAR & MapNpc(mapnum, MapNpcNum).X & SEP_CHAR & MapNpc(mapnum, MapNpcNum).Y & SEP_CHAR & MapNpc(mapnum, MapNpcNum).Dir & SEP_CHAR & Npc(MapNpc(mapnum, MapNpcNum).num).Big & END_CHAR
        ' Call SendDataToMap(mapnum, Packet)
        Call SaveMap(MapNum)
    End If

' MapNpc(mapnum, MapNpcNum).num = 0
' MapNpc(mapnum, MapNpcNum).SpawnWait = GetTickCount
' MapNpc(mapnum, MapNpcNum).HP = 0
' Call SendDataToMap(mapnum, "NPCDEAD" & SEP_CHAR & MapNpcNum & END_CHAR)

    Map(MapNum).Revision = Map(MapNum).Revision + 1

    MapPET(MapNum, MapPetNum).num = PETnum
    Map(MapNum).PET(MapPetNum) = PETnum

    MapPET(MapNum, MapPetNum).Target = 0

    MapPET(MapNum, MapPetNum).HP = GetNpcMaxHP(PETnum)
    MapPET(MapNum, MapPetNum).MP = GetNpcMaxMP(PETnum)
    MapPET(MapNum, MapPetNum).SP = GetNpcMaxSP(PETnum)

    MapPET(MapNum, MapPetNum).Dir = Int(Rnd * 4)

    MapPET(MapNum, MapPetNum).X = spawn_X
    MapPET(MapNum, MapPetNum).Y = spawn_Y

    packet = "SPAWNPET" & SEP_CHAR & MapPetNum & SEP_CHAR & MapPET(MapNum, MapPetNum).num & SEP_CHAR & MapPET(MapNum, MapPetNum).X & SEP_CHAR & MapPET(MapNum, MapPetNum).Y & SEP_CHAR & MapPET(MapNum, MapPetNum).Dir & SEP_CHAR & PETS(MapPET(MapNum, MapPetNum).num).Big & END_CHAR
    Call SendDataToMap(MapNum, packet)

    Call SaveMap(MapNum)

    For I = 1 To MAX_PLAYERS
        If IsPlaying(I) And GetPlayerMap(I) = MapNum Then
            Call SendDataTo(I, "CHECKFORMAP" & SEP_CHAR & GetPlayerMap(I) & SEP_CHAR & Map(GetPlayerMap(I)).Revision & END_CHAR)
        End If
    Next I

End Sub
```
Sorry i had to Fix Somethign On them Heres the New Ones
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...