Walox
Active Member
- Joined
- Jul 31, 2017
- Messages
- 39
- Reaction score
- 29
Hello guys, how are you? I'm trying to make an effect script.
how does it work ? basically when a pokemon drops an evolution stone the system will identify which stone the player dropped and send a different effect to that stone.
But I am not getting it because it is giving error; -;
can you help me with this? it seems to be very simple but I don't know much about LUA or C
error
Script
how does it work ? basically when a pokemon drops an evolution stone the system will identify which stone the player dropped and send a different effect to that stone.
But I am not getting it because it is giving error; -;
can you help me with this? it seems to be very simple but I don't know much about LUA or C
error
Script
Lua:
local effect = 173
local function func(cid, position, corpseid, effect)
local stoneEffect = {
["Fire Stone"] = 744,
["water stone"] = 745,
["leaf stone"] = 746,
["heart stone"] = 747,
["thunder stone"] = 748,
["venom stone"] = 749,
["enigma stone"] = 750,
["rock stone"] = 751,
["earth stone"] = 752,
["ice stone"] = 753,
["darkness stone"] = 754,
["punch stone"] = 755,
["coccon stone"] = 756,
["metal stone"] = 757,
["ancient stone"] = 758,
["crystal stone"] = 759,
["feather stone"] = 760,
}
if not isCreature(cid) then return true end
local corpse = getTileItemById(position, corpseid).uid
if corpse <= 1 then return end
if not isContainer(corpse) then return true end
for slot = 0, (getContainerSize(corpse)-1) do
local item = getContainerItem(corpse, slot)
if item.uid <= 1 then return end
if isStone(item.itemid) then
local posCorpse = getThingPos(item)
posCorpse.x = posCorpse.x +1
doSendMagicEffect(posCorpse, stoneEffect[getItemNameById(itemid):lower()])
posCorpse.y = posCorpse.y +1
addEvent(doSendMagicEffect, 2000, posCorpse, 285)
return
end
end
end
function onKill(cid, target, lastHit)
if not ehMonstro(target) then return true end
local corpse = getMonsterInfo(getCreatureName(target)).lookCorpse
addEvent(func, 5, getCreatureSummons(cid)[1], getThingPos(target), corpse, effect)
return true
end