Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- by Black Wolf of blackwolfsden aka slp13at420 of ac-web.org
- -- custom item drop for creature 3100
- -- when npc dies this script will act as auto looting
- -- generates a random number between 1 n 25 then applies to variable a
- -- adds item 44209 x a
- -- adds to mg column in db +3 mg
- local NPCID = 3100
- local function reward(player)
- player:AddItem(44209, math.random(1, 25))
- WorldDBQuery("UPDATE logon.accounts SET `mg` = `mg` + '3' WHERE `login` = '"..player:GetAccountName().."' LIMIT 1; ")
- player:SendBroadcastMessage("+3 mg earned")
- end
- local function Mottledboar_Unit_EVENT_ON_DIED(pUnit, event, player)
- if(player:IsInGroup()) then
- for _, v in pairs(player:GetGroupPlayers()) do
- if(v and v:IsInWorld()) then
- reward(v)
- end
- end
- else -- I assume GetGroupPlayers includes the killer also
- reward(player)
- end
- end
- RegisterUnitEvent(NPCID, 4, Mottledboar_Unit_EVENT_ON_DIED)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement