qsttalvraesbowl.lua 977 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. --[[
  2. Script Name : SpawnScripts/Butcherblock/qsttalvraesbowl.lua
  3. Script Author : jakejp
  4. Script Date : 2018.06.10 06:06:14
  5. Script Purpose :
  6. :
  7. --]]
  8. Whelp_SpawnIDs = {1080383, 1080612, 1080701, 1081148, 1081151, 1081154}
  9. local whelp = nil
  10. local five_minutes_ms = 5 * 60000
  11. local AMindOfMyOwn = 294
  12. function spawn(NPC)
  13. AddTimer(NPC, 500, "QuestCheckLoop")
  14. AddTimer(NPC, five_minutes_ms, "Despawn")
  15. end
  16. function QuestCheckLoop(NPC)
  17. AddTimer(NPC, 500, "QuestCheckLoop")
  18. local Player = GetTempVariable(NPC, "PlayerPointer")
  19. if Player == nil then
  20. return
  21. end
  22. for index, id in ipairs(Whelp_SpawnIDs) do
  23. whelp = GetSpawn(NPC, id)
  24. if whelp ~= nil and GetDistance(NPC, whelp) < 20 then
  25. break
  26. else
  27. whelp = nil
  28. end
  29. end
  30. if whelp ~= nil then
  31. Charm(Player, whelp)
  32. if GetQuestStep(Player, AMindOfMyOwn) == 1 then
  33. SetStepComplete(Player, AMindOfMyOwn, 1)
  34. end
  35. end
  36. end