Files

23 lines
559 B
Lua
Raw Permalink Normal View History

2023-03-14 03:51:18 -06:00
local npcId = 400092
local spellId = 100199
local range = 8
local killCreditNpcId = 400095
function OnSpellCast(event, player, spell)
if spell:GetEntry() == spellId then
nearestCreature = player:GetNearestCreature(range, npcId)
if nearestCreature == nil then
player:SendBroadcastMessage("You need to place the barrier in a more strategic location.")
spell:Cancel()
else
player:KilledMonsterCredit(killCreditNpcId)
2023-03-16 03:44:34 -06:00
player:SendBroadcastMessage("You have successfully built a barrier!")
2023-03-14 03:51:18 -06:00
end
end
end
RegisterPlayerEvent(5, OnSpellCast)