evilgoblintent2.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. --[[
  2. Script Name : SpawnScripts/OutpostOverlord/evilgoblintent2.lua
  3. Script Author : Vo1d
  4. Script Date : 2019.10.23 05:10:43
  5. Script Purpose :
  6. :
  7. --]]
  8. local TheFinalAssault = 367
  9. local EvilGoblinTent1 = 2780125
  10. local EvilGoblinTent2 = 2780124
  11. local EvilGoblinTent3 = 2780123
  12. function spawn(NPC)
  13. SetRequiredQuest(NPC, TheFinalAssault, 2)
  14. SpawnSet(NPC, "show_command_icon", 1)
  15. SpawnSet(NPC, "display_hand_icon", 1)
  16. end
  17. function respawn(NPC)
  18. Spawn(NPC)
  19. end
  20. function casted_on(NPC, Spawn, SpellName)
  21. if SpellName == "burn tent" then
  22. if CheckTent(Spawn, NPC) == true then
  23. if GetQuestStep(Spawn, TheFinalAssault) == 2 then
  24. SpawnSetByDistance(NPC, 15, "visual_state", 491)
  25. KillSpawnByDistance(NPC, 15, 0, 1)
  26. AddStepProgress(Spawn, TheFinalAssault, 2, 1)
  27. BurnTent(Spawn, NPC)
  28. elseif GetQuestStep(Spawn, TheFinalAssault) == 3 then
  29. SetStepComlete(Spawn, TheFinalAssault, 2)
  30. else
  31. end
  32. end
  33. end
  34. end
  35. function BurnTent(Caster, Target)
  36. SpawnSet(Target, "show_command_icon", 0)
  37. AddTimer(Target, 60000, "enable_command_icon_tent")
  38. end
  39. function enable_command_icon_tent(NPC, Player)
  40. SpawnSet(NPC, "show_command_icon", 1)
  41. end
  42. function CheckTent(Caster, Target)
  43. if GetSpawnID(Target) == EvilGoblinTent1 or
  44. GetSpawnID(Target) == EvilGoblinTent2 or
  45. GetSpawnID(Target) == EvilGoblinTent3 then
  46. return true
  47. else
  48. return false
  49. end
  50. end