Advertisement
GalaxyHells

Scripted Battle

Oct 7th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. - Server-Side -
  2.  
  3. 1. no modServerLooop, em cima de:
  4. ' Check for disconnections every half second
  5.  
  6. Add(Talvez vc tenha que adicionar um dim tmr250 as long ):
  7. '##Scripted Battle##
  8. If Tick > tmr250 Then
  9. For i = 1 To SMaxBattles
  10. ScriptedBattleSub i
  11. Next
  12.  
  13. tmr250 = GetTickCount + 250
  14. End If
  15.  
  16. 2. no modPlayer, na sub PlayerWarp, em baixo de:
  17. ' Regenerate all NPCs' health
  18. For i = 1 To MAX_MAP_NPCS
  19.  
  20. If MapNpc(OldMap).Npc(i).num > 0 Then
  21. MapNpc(OldMap).Npc(i).Vital(Vitals.HP) = GetNpcMaxVital(MapNpc(OldMap).Npc(i).num, Vitals.HP)
  22. End If
  23.  
  24. Next
  25.  
  26. add:
  27. '##Scripted Battle##
  28. ClearScriptedBattle OldMap, 0, True
  29.  
  30. 3. Na Sub NpcWarpBehind, em baixo de:
  31. If index < 1 Or index > MAX_PLAYERS Then Exit Sub
  32. If NpcID < 1 Or NpcID > MAX_MAP_NPCS Then Exit Sub
  33.  
  34. Add: '##Scripted Battle##
  35. If IsPlaying(index) = False Then Exit Sub
  36.  
  37. 4. Na sub PlayerAttackNpc, em baixo de:
  38. If Damage >= MapNpc(mapNum).Npc(mapNpcNum).Vital(Vitals.HP) Then
  39.  
  40. Add:
  41. '##Scripted Battle##
  42. ClearScriptedBattle mapNum, mapNpcNum
  43.  
  44. 5. Na msm sub, em baixo de:
  45. ' NPC not dead, just do the damage
  46. MapNpc(mapNum).Npc(mapNpcNum).Vital(Vitals.HP) = MapNpc(mapNum).Npc(mapNpcNum).Vital(Vitals.HP) - Damage
  47.  
  48. Add:
  49. '##Scripted Battle##
  50. ConfigureScriptedBattle
  51.  
  52. For i = 1 To SMaxBattles
  53. If sBattle(i).SOn = False Then
  54. ScriptedBattleSub i, mapNum, mapNpcNum
  55. Exit For
  56. End If
  57. Next
  58.  
  59. 6. Na sub NpcAttackPlayer, em baixo de:
  60. If Damage >= GetPlayerVital(victim, Vitals.HP) Then
  61.  
  62. Add:
  63. '##Scripted Battle##
  64. ClearScriptedBattle mapNum, mapNpcNum, True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement