Add files via upload

This commit is contained in:
Dinkledork
2023-03-03 16:34:18 -07:00
committed by GitHub
parent 36942f9202
commit 9fc55f4488
27 changed files with 497 additions and 44 deletions

View File

@@ -1,23 +1,24 @@
local SWG_IDS = {68, 400033, 4034}
local SWG_IDS = {68, 400013, 400033, 400014, 1976}
local SPELL_ID = 100141
function OnSpellCast(event, caster, spell)
local target = spell:GetTarget()
if target and spell:GetEntry() == SPELL_ID then
local isValidTarget = false
for _, swgID in ipairs(SWG_IDS) do
if target:GetEntry() == swgID then
isValidTarget = true
break
end
end
if not isValidTarget then
caster:SendBroadcastMessage("Invalid target for this spell.")
spell:Cancel()
else
caster:KilledMonsterCredit(target:GetEntry())
end
end
local target = spell:GetTarget()
if target and spell:GetEntry() == SPELL_ID then
local isValidTarget = false
for _, swgID in ipairs(SWG_IDS) do
if target:GetEntry() == swgID then
isValidTarget = true
break
end
end
if not isValidTarget then
caster:SendBroadcastMessage("Invalid target for this spell.")
spell:Cancel()
else
-- give kill credit to NPC ID 68
caster:KilledMonsterCredit(68)
end
end
end
RegisterPlayerEvent(5, OnSpellCast)
RegisterPlayerEvent(5, OnSpellCast)