Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //--------------------------------------
- // DO NOT DELETE
- // Default Pet Script
- //--------------------------------------
- // Global Settings; Effects all modes
- Dim owner As Integer
- owner = pet_owner(index)
- If get_online(owner) = False Then
- pet_unsummon(index) // Owner offline; kill pet
- ElseIf get_pmap(owner) <> map Then
- If get_pmap(owner) = -1 Then
- pet_unsummon(index)
- Else
- pet_warp(index,owner) // Owner on a different map; teleport
- End If
- ElseIf get_pdistance(owner) > (pet_range(index) * 2) Then
- pet_unsummon(index) // Pet too far from owner; unsummon it
- ElseIf get_pdistance(owner) > pet_range(index) Then
- action_pseek(index,owner) // Pet too far from owner; follow him
- Else
- Select Case pet_mode(index) // Pet within range; run mode action
- Case 0 // Fight
- Dim target As Integer
- target = pet_targetnpc(index) // Find npc/pet target
- If target <> -1 Then // Found NPC target; fight it
- action_nattack(index,target)
- Return
- ElseIf map_pk Then // PK Map
- target = pet_targetplayer(index) // Find player target
- If target <> -1 Then // Found player target; fight it
- action_pattack(index,target)
- Return
- End If
- End If
- // No targets found; wander around owner
- pet_wander(index,-1)
- Case 1 // PK
- If map_pk Then
- Dim target As Integer
- target = pet_targetplayer(index)
- If target <> -1 Then
- action_pattack(index,target)
- Return
- End If
- End If
- If action_flank(index,pet_owner(index)) Then
- End If
- Case 2 // Follow
- If action_flank(index,pet_owner(index)) Then
- End If
- End Select
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement