1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- --[[
- Script Name : SpawnScripts/Commonlands/NWUndeathSentry.lua
- Script Author : Premierio015
- Script Date : 2021.05.12 09:05:54
- Script Purpose :
- :
- --]]
- local BrokenEquipment = 415
- function spawn(NPC)
- SetPlayerProximityFunction(NPC, 10, "InRange")
- end
- function respawn(NPC)
- spawn(NPC)
- end
- function InRange(NPC, Spawn)
- if HasQuest(Spawn, BrokenEquipment) then
- AddSpawnAccess(NPC, Spawn)
- AddPrimaryEntityCommand(Spawn, NPC, "repair", 2, "")
- elseif QuestStepIsComplete(Spawn, BrokenEquipment) == 3 then
- RemoveSpawnAccess(NPC, Spawn)
- end
- end
- function casted_on(NPC, Spawn, SpellName)
- if SpellName == 'repair' and HasItem(Spawn, 15095) then
- if HasQuest(Spawn, BrokenEquipment) and not QuestStepIsComplete(Spawn, BrokenEquipment, 3) then
- SetStepComplete(Spawn, BrokenEquipment, 3)
- RemoveItem(Spawn, 15095)
- elseif not HasItem(Spawn, 15095) then
- SendMessage(Spawn, "You need an undying essence to repair the sentry. You can get one from the undead that patrol these ruins")
- end
- end
- end
|