forked from ornfelt/azerothcore_lua_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDropLootOnKillArea.lua
More file actions
25 lines (19 loc) · 819 Bytes
/
DropLootOnKillArea.lua
File metadata and controls
25 lines (19 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--[[ Helped a person to fix this.]]
local npcid = 17259
local chance = 0.30
local DropSolo = {51800, 51803, 50793, 51011, 51384, 51788}
math.randomseed(os.time()) --If you want a different sequence of random numbers, then pass this. os.time() will return the time in number of seconds so it will be different every time.
function BonechewerHungerer(event, creature, killer)
local item, range, isHostile, isDead = 12345, 50, 0, 0
local players = creature:GetPlayersInRange(range, isHostile, isDead)
if (players) then
for _, player in pairs(players) do
for _, v in pairs(DropSolo) do
if (math.random() < chance) then
player:AddItem(v)
end
end
end
end
end
RegisterCreatureEvent(npcid, 4, BonechewerHungerer)