evilgoblintent1.lua 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. --[[
  2. Script Name : SpawnScripts/OutpostOverlord/evilgoblintent1.lua
  3. Script Author : Vo1d
  4. Script Date : 2019.10.23 05:10:42
  5. Modified Date : 20.05.2020
  6. Modified by : premierio015
  7. Modified Notes : Now burn all the tunarians around the tent. TODO: Chat shows messages "evil_goblin_tent has killed <mobname>, should be removed somehow. Tent should have huge fire visual state, according to packet data effect should be applied on "dpo_invisible_cube" object and not on tent widget.
  8. --]]
  9. local TheFinalAssault = 367
  10. local EvilGoblinTent1 = 2780125
  11. local EvilGoblinTent2 = 2780124
  12. local EvilGoblinTent3 = 2780123
  13. function spawn(NPC)
  14. SetRequiredQuest(NPC, TheFinalAssault, 2)
  15. SpawnSet(NPC, "show_command_icon", 1)
  16. SpawnSet(NPC, "display_hand_icon", 1)
  17. end
  18. function respawn(NPC)
  19. Spawn(NPC)
  20. end
  21. function casted_on(NPC, Spawn, SpellName)
  22. if SpellName == "burn tent" then
  23. if CheckTent(Spawn, NPC) == true then
  24. if GetQuestStep(Spawn, TheFinalAssault) == 2 then
  25. SpawnSetByDistance(NPC, 15, "visual_state", 491)
  26. KillSpawnByDistance(NPC, 15, 0, 1)
  27. AddStepProgress(Spawn, TheFinalAssault, 2, 1)
  28. BurnTent(Spawn, NPC)
  29. elseif GetQuestStep(Spawn, TheFinalAssault) == 3 then
  30. SetStepComlete(Spawn, TheFinalAssault, 2)
  31. else
  32. end
  33. end
  34. end
  35. end
  36. function BurnTent(NPC, Spawn)
  37. SpawnSet(NPC, "show_command_icon", 0)
  38. AddTimer(NPC, 60000, "enable_command_icon_tent")
  39. end
  40. function enable_command_icon_tent(NPC, Player)
  41. SpawnSet(NPC, "show_command_icon", 1)
  42. end
  43. function CheckTent(Caster, Target)
  44. if GetSpawnID(Target) == EvilGoblinTent1 or
  45. GetSpawnID(Target) == EvilGoblinTent2 or
  46. GetSpawnID(Target) == EvilGoblinTent3 then
  47. return true
  48. else
  49. return false
  50. end
  51. end