9
3

scarwurmpheromone.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. --[[
  2. Script Name : ItemScripts/scarwurmpheromone.lua
  3. Script Purpose : clickable used in quest "The Mother Lode"
  4. Script Author : fearfx
  5. Script Date : 24 Jan 2017
  6. Script Notes : Summons "the wurm mother" (ID = 341051)
  7. --]]
  8. local TheMotherLode = 148
  9. function used(Item, Player)
  10. local zone = GetZone(Player)
  11. local x = GetX(Player)
  12. local y = GetY(Player)
  13. local z = GetZ(Player)
  14. if x >= -490 and x <= -438 and z <= -43 and z >= -76 and y <= -48 and y >= -53 and GetTempVariable(Player, "WurmMother") == nil and GetQuestStep(Player, TheMotherLode) ~= 3 then
  15. local zone = GetZone(Player)
  16. local newSpawn = SpawnMob(zone, 341051, 1, -464.18, -49.33, -60.43, 242.84)
  17. if newSpawn ~= nil then
  18. AddSpawnAccess(newSpawn, Player)
  19. AddStepProgress(Player, TheMotherLode, 1, 1)
  20. SetTempVariable(Player, "WurmMother", "1")
  21. end
  22. elseif GetQuestStep(Player, TheMotherLode) == 3 then
  23. SendMessage(Player, "You have already killed The Wurm Mother.", "yellow")
  24. elseif GetTempVariable(Player, "WurmMother") ~= nil then
  25. SendMessage(Player, "The Wurm Mother has already been summoned.", "yellow")
  26. else
  27. SendMessage(Player, "You must use this item on the bridge that spans Innoruuk's Scar.", "yellow")
  28. end
  29. end