quest_machine_in_water.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --[[
  2. Script Name : SpawnScripts/PeatBog/quest_machine_in_water.lua
  3. Script Purpose : quest_machine_in_water
  4. Script Author : Scatman
  5. Script Date : 2009.05.10
  6. Script Notes :
  7. --]]
  8. local QUEST_2 = 216
  9. local gnoll_spawned_recently = false
  10. function spawn(NPC)
  11. --SetRequiredQuest(NPC, QUEST_2, 1)
  12. gnoll_spawned_recently = false
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function hailed(NPC, Spawn)
  18. end
  19. function casted_on(Target, Caster)
  20. if HasQuest(Caster, QUEST_2) and GetQuestStep(Caster, QUEST_2) == 1 then
  21. if gnoll_spawned_recently == false then
  22. gnoll_spawned_recently = true
  23. SendMessage(Caster, "Before you can attach the beacon you hear a howl nearby.")
  24. Gnoll = SpawnMob(GetZone(Caster), GetRandomGnollID(), false, GetX(Target), GetY(Target), GetZ(Target))
  25. AddHate(Caster, Gnoll, 100)
  26. AddTimer(Target, 30000, "ResetGnoll")
  27. else
  28. SetStepComplete(Caster, QUEST_2, 1)
  29. end
  30. end
  31. end
  32. function GetRandomGnollID()
  33. choice = math.random(1, 2)
  34. -- 1 of 2 'a gnoll machinist'
  35. if choice == 1 then
  36. return 1980103
  37. elseif choice == 2 then
  38. return 1980102
  39. end
  40. end
  41. function ResetGnoll(NPC)
  42. gnoll_spawned_recently = false
  43. end