• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua [ERROR] Effect when dropping certain item from a monster!

boxxer321

Active Member
Joined
Nov 5, 2011
Messages
112
Reaction score
42
hey, guys!

I have a script that does an effect "x" if a particular item drop from a monster, but the effect is coming to the left side of my pokémon, where it should come out on top of the corpse, could anyone help me?

Lua:
local stone_effects = {

--[itemid] = effect,

--Ex.:

[11447] = 297,

[11442] = 298,

}

 

local function sendEffStone(cid, pos, stones)

if not isCreature(cid) then return true end

for i = 1, 255 do

pos.stackpos = i

local item = getTileThingByPos(pos)

if item.uid ~= 0 then

if isContainer(item.uid) then

if isContainer(item.uid) and getContainerSize(item.uid) > 0 then

for slot=0, (getContainerSize(item.uid)-1) do

local stone = getContainerItem(item.uid, slot)

if isInArray(stones, stone.itemid) and stone_effects[stone.itemid] then

doSendMagicEffect(getThingPos(cid), stone_effects[stone.itemid])

end

end

end

end

end

end

end

 

function onKill(cid, target)

local stones = {11453, 11441, 11442, 11443, 11444, 11445, 11446, 11447, 11448, 11449, 11450, 11451, 11452, 11454, 12244, 12232, 12242, 12417, 12419, 12245, 12401, 12402, 12403, 12404, 12405, 12406, 12407, 12408, 12409, 12410, 12411, 12412, 12413, 12414} --id de todas as stones

 

if ehMonstro(target) and isPlayer(cid) then

local pos = getThingPos(target)

local pid = getCreatureSummons(cid)[1]

addEvent(sendEffStone, 150, pid, pos, stones)

end

 

return true

end
 
Back
Top