evilgravestonespawner.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --[[
  2. Script Name : SpawnScripts/IsleRefuge1/evilgravestonespawner.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.09.20 12:09:43
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SetRequiredQuest(NPC, 5747, 1)
  10. SetRequiredQuest(NPC, 5747, 2)
  11. end
  12. function casted_on(NPC, Spawn, Message)
  13. local zone = GetZone(NPC)
  14. local Rockbelly = GetSpawnByLocationID(zone, 133774610)
  15. if Message == "kick gravestone" and Rockbelly == nil then
  16. if GetQuestStep(Spawn,5747) ==1 then
  17. -- SendPopUpMessage(Spawn, "You have disturbed the fallen captain's grave!", 230, 230, 230)
  18. RockbellyNew = SpawnByLocationID(zone,133774610)
  19. AddTimer(NPC,2000,"Attacking",1,Spawn)
  20. SetStepComplete(Spawn,5747,1)
  21. SetAccessToEntityCommand(Spawn,NPC,"kick gravestone", 0)
  22. SpawnSet(NPC, "show_command_icon", 0)
  23. AddTimer(NPC,30000,"Reset")
  24. end
  25. end
  26. end
  27. function Reset(NPC)
  28. SetAccessToEntityCommand(Spawn,NPC,"kick gravestone", 1)
  29. SpawnSet(NPC, "show_command_icon", 1)
  30. end
  31. function Attacking(NPC,Spawn)
  32. local zone = GetZone(NPC)
  33. Rockbelly = GetSpawnByLocationID(zone,133774610)
  34. PlayFlavor(Rockbelly, "voiceover/english/captain_rockbelly/tutorial_island02_fvo_ghostshout.mp3", "Get youz away from meez treasures! Dis meez loots!", "", 3040387050, 4243014787)
  35. if IsInCombat(Rockbelly)==false then
  36. Attack(Rockbelly,Spawn)
  37. end
  38. end
  39. function respawn(NPC)
  40. spawn(NPC)
  41. end