Add files via upload

This commit is contained in:
Dinkledork
2023-02-15 15:04:02 -07:00
committed by GitHub
parent 20cf067590
commit cc5afc7c6c
15 changed files with 430 additions and 23 deletions

23
SWGKillCred.lua Normal file
View File

@@ -0,0 +1,23 @@
local SWG_IDS = {68, 400033, 4034}
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
end
RegisterPlayerEvent(5, OnSpellCast)