mirror of
https://github.com/emagi/eq2emu-content
synced 2026-08-12 20:23:03 -04:00
45 lines
No EOL
1.4 KiB
Lua
Executable file
45 lines
No EOL
1.4 KiB
Lua
Executable file
--[[
|
|
Script Name : SpawnScripts/FallenGate/chest.lua
|
|
Script Author : Premierio015
|
|
Script Date : 2021.07.10 04:07:04
|
|
Script Purpose :
|
|
:
|
|
--]]
|
|
|
|
local ChargeOfTheLeatherfootBrigade_TheSarge = 5311
|
|
|
|
|
|
|
|
|
|
|
|
function spawn(NPC)
|
|
SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
|
|
end
|
|
|
|
function InRange(NPC, Spawn)
|
|
if not HasQuest(Spawn, ChargeOfTheLeatherfootBrigade_TheSarge) or HasCompletedQuest(Spawn, ChargeOfTheLeatherfootBrigade_TheSarge) then
|
|
SpawnSet(NPC, "show_command_icon", 0)
|
|
SpawnSet(NPC, "display_hand_icon", 0)
|
|
SetAccessToEntityCommand(Spawn,NPC,"Open Chest", 0)
|
|
elseif HasQuest(Spawn, ChargeOfTheLeatherfootBrigade_TheSarge) then
|
|
SpawnSet(NPC, "show_command_icon", 1)
|
|
SpawnSet(NPC, "display_hand_icon", 1)
|
|
SetAccessToEntityCommand(Spawn,NPC,"Open Chest", 1)
|
|
end
|
|
end
|
|
|
|
function casted_on(NPC, Spawn, SpellName)
|
|
if SpellName == 'Open Chest' then
|
|
if GetQuestStep(Spawn, ChargeOfTheLeatherfootBrigade_TheSarge) == 2 then
|
|
SetStepComplete(Spawn, ChargeOfTheLeatherfootBrigade_TheSarge, 2)
|
|
SendMessage(Spawn, "You find a ghostly ring inside the chest.")
|
|
SpawnSet(NPC, "show_command_icon", 0)
|
|
SpawnSet(NPC, "display_hand_icon", 0)
|
|
SetAccessToEntityCommand(Spawn,NPC,"Open Chest", 0)
|
|
end
|
|
end
|
|
end
|
|
|
|
function respawn(NPC)
|
|
spawn(NPC)
|
|
end |