mirror of
https://github.com/araxiaonline/RandomScriptsforAzerothCore.git
synced 2026-06-13 02:22:19 -04:00
Add files via upload
This commit is contained in:
22
Barrier.lua
Normal file
22
Barrier.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
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)
|
||||
player:SendBroadcastMessage("You have successfully placed the barrier and received kill credit for NPC " .. killCreditNpcId .. ".")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
RegisterPlayerEvent(5, OnSpellCast)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user