• 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!

Equiping Animation

The Mapper

Just Imagine
Joined
Jul 22, 2009
Messages
182
Reaction score
2
I need this movement, when a player equips certain kind of boots or armor every time he steps out the animation number /z 66 would appear. Can anyone do it for me?
 
in movements;
Code:
function onDeEquip(cid, item, slot)
    setPlayerStorageValue(cid, 1234, -1)
end
and
Code:
function onEquip(cid, item, slot)
    setPlayerStorageValue(cid, 1234, 1)
end
and
Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local t = toPosition
local f = fromPosition
    if getPlayerStorageValue(cid, 1234) == 1 then
        if t.x == f.x+1 or t.x == f.x-1 or t.y == f.y+1 or t.y == f.y-1 or t.z == f.z+1 or t.z == f.z-1 then
            doSendMagicEffect(getPlayerPosition(cid), 66)
        end
    end
return true
end
Test this ;p
The storage need to be the same in all scripts(1234 in this case)
 
Last edited:
wouldn't it work to just do like
Code:
<movevent type="StepIn" itemid="[B]1-10000[/B]" event="script" value="anything.lua"/>
;p
You can't step on walls or such anyway, so..?
but maybe it would spam massive errors in the console "duplicate item" something xD
 
with certain weapons and spells on games the player gets a spinning effect around players is it possible to make that with equipment

example, player equips blessed sceptre and has a spinning affect around him
1,1,1
1,0,1
1,1,1

its like this

1,2,3
8,0,4
7,6,5 it starts off at 1 and spins clockwise around him
 
well not only when hitting a creature it always shows the effect when wearing certain equipment, so an effect moves around you

an example:
LUA:
local playerfirsteffect = CONST_ME_YELLOW_RINGS
local playersecondeffect = CONST_ME_BLOCKHIT
local playerflingeffect = CONST_ANI_SMALLHOLY
local playerlandeffect = CONST_ME_HOLYAREA

local pos = getCreaturePosition(param.cid)

local nha = {x = pos.x, y = pos.y - 1, z = pos.z, stackpos = 255}
local sha = {x = pos.x, y = pos.y + 1, z = pos.z, stackpos = 255}
local wha = {x = pos.x - 1, y = pos.y, z = pos.z, stackpos = 255}
local eha = {x = pos.x + 1, y = pos.y, z = pos.z, stackpos = 255}

local nwa = {x = pos.x - 1, y = pos.y - 1, z = pos.z, stackpos = 255}
local nea = {x = pos.x + 1, y = pos.y - 1, z = pos.z, stackpos = 255}
local sea = {x = pos.x + 1, y = pos.y + 1, z = pos.z, stackpos = 255}
local swa = {x = pos.x - 1, y = pos.y + 1, z = pos.z, stackpos = 255}

doSendMagicEffect(pos, playerfirsteffect)
doSendMagicEffect(pos, playersecondeffect)

doSendDistanceShoot(pos, nha, playerflingeffect)
doSendDistanceShoot(pos, sha, playerflingeffect)
doSendDistanceShoot(pos, wha, playerflingeffect)
doSendDistanceShoot(pos, eha, playerflingeffect)
doSendDistanceShoot(pos, nwa, playerflingeffect)
doSendDistanceShoot(pos, nea, playerflingeffect)
doSendDistanceShoot(pos, sea, playerflingeffect)
doSendDistanceShoot(pos, swa, playerflingeffect)

doSendMagicEffect(nha, playerlandeffect)
doSendMagicEffect(sha, playerlandeffect)
doSendMagicEffect(wha, playerlandeffect)
doSendMagicEffect(eha, playerlandeffect)
doSendMagicEffect(nwa, playerlandeffect)
doSendMagicEffect(nea, playerlandeffect)
doSendMagicEffect(sea, playerlandeffect)
doSendMagicEffect(swa, playerlandeffect)

and make these effects loop on a certain piece of equipment when worn?
 
Last edited:
k so test these ;p
movements.xml:
Code:
<movevent type="Equip" itemid="[B]XXXX[/B]" slot="[B]feet[/B]" event="script" value="[B]somethingEquip.lua[/B]"/>
<movevent type="Equip" itemid="[B]XXXX[/B]" slot="[B]feet[/B]" event="script" value=[B]"somethingDeEquip.lua[/B]"/>
movements/scripts/somethingEquip.lua:
Code:
function onEquip(cid, item, slot)
    setPlayerStorageValue(cid, 1234, 1)
end
movements/scripts/somethingDeEquip.lua:
Code:
function onDeEquip(cid, item, slot)
    setPlayerStorageValue(cid, 1234, -1)
end
Globalevents.xml:
Code:
<globalevent name="something" interval="1" event="script" value="[B]something.lua[/B]"/>
I think interval="1" means 1 second or 1000 means 1 second ;p
globalevents/scripts/something.lua:
Code:
function onThink(cid, interval)
    if getPlayerStorageValue(cid, 1234) == 1 then
        for _, cid in ipairs(getOnlinePlayers()) do
            local playerfirsteffect = CONST_ME_YELLOW_RINGS
            local playersecondeffect = CONST_ME_BLOCKHIT
            local playerflingeffect = CONST_ANI_SMALLHOLY
            local playerlandeffect = CONST_ME_HOLYAREA

            local pos = getCreaturePosition(cid)

            local nha = {x = pos.x, y = pos.y - 1, z = pos.z, stackpos = 255}
            local sha = {x = pos.x, y = pos.y + 1, z = pos.z, stackpos = 255}
            local wha = {x = pos.x - 1, y = pos.y, z = pos.z, stackpos = 255}
            local eha = {x = pos.x + 1, y = pos.y, z = pos.z, stackpos = 255}

            local nwa = {x = pos.x - 1, y = pos.y - 1, z = pos.z, stackpos = 255}
            local nea = {x = pos.x + 1, y = pos.y - 1, z = pos.z, stackpos = 255}
            local sea = {x = pos.x + 1, y = pos.y + 1, z = pos.z, stackpos = 255}
            local swa = {x = pos.x - 1, y = pos.y + 1, z = pos.z, stackpos = 255}

            doSendMagicEffect(pos, playerfirsteffect)
            doSendMagicEffect(pos, playersecondeffect)

            doSendDistanceShoot(pos, nha, playerflingeffect)
            doSendDistanceShoot(pos, sha, playerflingeffect)
            doSendDistanceShoot(pos, wha, playerflingeffect)
            doSendDistanceShoot(pos, eha, playerflingeffect)
            doSendDistanceShoot(pos, nwa, playerflingeffect)
            doSendDistanceShoot(pos, nea, playerflingeffect)
            doSendDistanceShoot(pos, sea, playerflingeffect)
            doSendDistanceShoot(pos, swa, playerflingeffect)

            doSendMagicEffect(nha, playerlandeffect)
            doSendMagicEffect(sha, playerlandeffect)
            doSendMagicEffect(wha, playerlandeffect)
            doSendMagicEffect(eha, playerlandeffect)
            doSendMagicEffect(nwa, playerlandeffect)
            doSendMagicEffect(nea, playerlandeffect)
            doSendMagicEffect(sea, playerlandeffect)
            doSendMagicEffect(swa, playerlandeffect)
        end
    end
end
 
Back
Top