Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.60 KB | None | 0 0
  1. //--------------------------------------
  2. // DO NOT DELETE
  3. // Default Pet Script
  4. //--------------------------------------
  5. // Global Settings; Effects all modes
  6. Dim owner As Integer
  7.  
  8. owner = pet_owner(index)
  9.  
  10. If get_online(owner) = False Then
  11.     pet_unsummon(index) // Owner offline; kill pet
  12.  
  13. ElseIf get_pmap(owner) <> map Then
  14.     If get_pmap(owner) = -1 Then
  15.         pet_unsummon(index)
  16.     Else
  17.         pet_warp(index,owner) // Owner on a different map; teleport
  18.  
  19.     End If
  20.  
  21. ElseIf get_pdistance(owner) > (pet_range(index) * 2) Then
  22.     pet_unsummon(index) // Pet too far from owner; unsummon it
  23.  
  24. ElseIf get_pdistance(owner) > pet_range(index) Then
  25.     action_pseek(index,owner) // Pet too far from owner; follow him
  26.  
  27. Else
  28.     Select Case pet_mode(index) // Pet within range; run mode action
  29.     Case 0 // Fight
  30.         Dim target As Integer
  31.  
  32.         target = pet_targetnpc(index) // Find npc/pet target
  33.  
  34.         If target <> -1 Then // Found NPC target; fight it
  35.             action_nattack(index,target)
  36.             Return
  37.  
  38.         ElseIf map_pk Then // PK Map
  39.             target = pet_targetplayer(index) // Find player target
  40.  
  41.             If target <> -1 Then // Found player target; fight it
  42.                 action_pattack(index,target)
  43.                 Return
  44.  
  45.             End If
  46.         End If
  47.  
  48.         // No targets found; wander around owner
  49.         pet_wander(index,-1)
  50.  
  51.     Case 1 // PK
  52.         If map_pk Then
  53.             Dim target As Integer
  54.  
  55.             target = pet_targetplayer(index)
  56.  
  57.             If target <> -1 Then
  58.                 action_pattack(index,target)
  59.                 Return
  60.             End If
  61.         End If
  62.  
  63.         If action_flank(index,pet_owner(index)) Then
  64.         End If
  65.  
  66.     Case 2 // Follow
  67.         If action_flank(index,pet_owner(index)) Then
  68.         End If
  69.  
  70.     End Select
  71. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement