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

MoveEvent [TFS 1.3] Cool looking transforming ring with aura effect and extra health & mana

Marko999x

999x era
Premium User
Joined
Dec 14, 2017
Messages
2,755
Solutions
80
Reaction score
1,893
Location
Germany
Preview:

Ring gives you custom outfit, custom aura effect + 20% extra health & mana

data/movements/movements.xml
Lua:
    <movevent event="Equip" itemid="YourRingID" slot="ring" script="YourScriptName.lua" />
    <movevent event="DeEquip" itemid="YourRingID" slot="ring" script="YourScriptName.lua" />

data/movements/YourScriptName.lua
Lua:
local config = {
    outfit = 104,
    effect = 12, -- Effect on equip and deequip
    distanceeffect = 36, -- Distance effect on equip and deequip
    distanceeffectaura = 36, -- Distance effect aura
    -- animation means how fast the aura should go around the player so 500 = 0.5 sec, 1 sec = 1000
    animation = 500
}   

-- Do not change the ticks or sub ids if you don't know how to do that :D
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, -1)
condition:setParameter(CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 120)
condition:setParameter(CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, 120)
condition:setParameter(CONDITION_PARAM_SUBID, 1)

-- Do not change the ticks or sub ids if you don't know how to do that :D
local condition2 = Condition(CONDITION_OUTFIT)
condition2:setParameter(CONDITION_PARAM_TICKS, -1)
condition2:setOutfit({lookType = config.outfit})
condition2:setParameter(CONDITION_PARAM_SUBID, 1)

function RingAura(cid)
    local player = Player(cid)
    if player then
        local pos = player:getPosition()
        Position(pos.x, pos.y+1, pos.z):sendDistanceEffect(Position(pos.x-1, pos.y, pos.z), config.distanceeffectaura)       
        Position(pos.x-1, pos.y, pos.z):sendDistanceEffect(Position(pos.x, pos.y-1, pos.z), config.distanceeffectaura)
        Position(pos.x, pos.y-1, pos.z):sendDistanceEffect(Position(pos.x+1, pos.y, pos.z), config.distanceeffectaura)
        Position(pos.x+1, pos.y, pos.z):sendDistanceEffect(Position(pos.x, pos.y+1, pos.z), config.distanceeffectaura)
        effect = addEvent(RingAura, 1 * config.animation, cid)
    else
        effect = nil
    end
end

function onEquip(player, item, slot, isCheck)
    if isCheck then
        return true
    end
    local pos = player:getPosition()
    player:addCondition(condition)
    player:addCondition(condition2)
    pos:sendMagicEffect(config.effect)
    player:say('ACTIVATED', TALKTYPE_MONSTER_SAY)
    Position(pos.x+1, pos.y+1, pos.z):sendDistanceEffect(pos, config.distanceeffect)
    Position(pos.x+1, pos.y-1, pos.z):sendDistanceEffect(pos, config.distanceeffect)
    Position(pos.x-1, pos.y-1, pos.z):sendDistanceEffect(pos, config.distanceeffect)
    Position(pos.x-1, pos.y+1, pos.z):sendDistanceEffect(pos, config.distanceeffect)
    effect = addEvent(RingAura, 1 * 1000, player:getId())
end

function onDeEquip(player, item, slot)
    local pos = player:getPosition()
    pos:sendMagicEffect(config.effect)
    pos:sendDistanceEffect(Position(pos.x+1, pos.y+1, pos.z), config.distanceeffect)
    pos:sendDistanceEffect(Position(pos.x+1, pos.y-1, pos.z), config.distanceeffect)
    pos:sendDistanceEffect(Position(pos.x-1, pos.y-1, pos.z), config.distanceeffect)
    pos:sendDistanceEffect(Position(pos.x-1, pos.y+1, pos.z), config.distanceeffect)
    player:say('DEACTIVATED', TALKTYPE_MONSTER_SAY)
    stopEvent(effect)
    player:removeCondition(CONDITION_ATTRIBUTES, condition, 1)
    player:removeCondition(CONDITION_OUTFIT, condition2, 1)
    return true
end
 
Hello
Why my ring stays in the backpack and activates the action when i put it on my set?
 
Preview:

Ring gives you custom outfit, custom aura effect + 20% extra health & mana

data/movements/movements.xml
Lua:
    <movevent event="Equip" itemid="YourRingID" slot="ring" script="YourScriptName.lua" />
    <movevent event="DeEquip" itemid="YourRingID" slot="ring" script="YourScriptName.lua" />

data/movements/YourScriptName.lua
Lua:
local config = {
    outfit = 104,
    effect = 12, -- Effect on equip and deequip
    distanceeffect = 36, -- Distance effect on equip and deequip
    distanceeffectaura = 36, -- Distance effect aura
    -- animation means how fast the aura should go around the player so 500 = 0.5 sec, 1 sec = 1000
    animation = 500
}  

-- Do not change the ticks or sub ids if you don't know how to do that :D
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, -1)
condition:setParameter(CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 120)
condition:setParameter(CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, 120)
condition:setParameter(CONDITION_PARAM_SUBID, 1)

-- Do not change the ticks or sub ids if you don't know how to do that :D
local condition2 = Condition(CONDITION_OUTFIT)
condition2:setParameter(CONDITION_PARAM_TICKS, -1)
condition2:setOutfit({lookType = config.outfit})
condition2:setParameter(CONDITION_PARAM_SUBID, 1)

function RingAura(cid)
    local player = Player(cid)
    if player then
        local pos = player:getPosition()
        Position(pos.x, pos.y+1, pos.z):sendDistanceEffect(Position(pos.x-1, pos.y, pos.z), config.distanceeffectaura)      
        Position(pos.x-1, pos.y, pos.z):sendDistanceEffect(Position(pos.x, pos.y-1, pos.z), config.distanceeffectaura)
        Position(pos.x, pos.y-1, pos.z):sendDistanceEffect(Position(pos.x+1, pos.y, pos.z), config.distanceeffectaura)
        Position(pos.x+1, pos.y, pos.z):sendDistanceEffect(Position(pos.x, pos.y+1, pos.z), config.distanceeffectaura)
        effect = addEvent(RingAura, 1 * config.animation, cid)
    else
        effect = nil
    end
end

function onEquip(player, item, slot, isCheck)
    if isCheck then
        return true
    end
    local pos = player:getPosition()
    player:addCondition(condition)
    player:addCondition(condition2)
    pos:sendMagicEffect(config.effect)
    player:say('ACTIVATED', TALKTYPE_MONSTER_SAY)
    Position(pos.x+1, pos.y+1, pos.z):sendDistanceEffect(pos, config.distanceeffect)
    Position(pos.x+1, pos.y-1, pos.z):sendDistanceEffect(pos, config.distanceeffect)
    Position(pos.x-1, pos.y-1, pos.z):sendDistanceEffect(pos, config.distanceeffect)
    Position(pos.x-1, pos.y+1, pos.z):sendDistanceEffect(pos, config.distanceeffect)
    effect = addEvent(RingAura, 1 * 1000, player:getId())
end

function onDeEquip(player, item, slot)
    local pos = player:getPosition()
    pos:sendMagicEffect(config.effect)
    pos:sendDistanceEffect(Position(pos.x+1, pos.y+1, pos.z), config.distanceeffect)
    pos:sendDistanceEffect(Position(pos.x+1, pos.y-1, pos.z), config.distanceeffect)
    pos:sendDistanceEffect(Position(pos.x-1, pos.y-1, pos.z), config.distanceeffect)
    pos:sendDistanceEffect(Position(pos.x-1, pos.y+1, pos.z), config.distanceeffect)
    player:say('DEACTIVATED', TALKTYPE_MONSTER_SAY)
    stopEvent(effect)
    player:removeCondition(CONDITION_ATTRIBUTES, condition, 1)
    player:removeCondition(CONDITION_OUTFIT, condition2, 1)
    return true
end
reminds roxor, thanks for share :)
 
Preview:

Ring gives you custom outfit, custom aura effect + 20% extra health & mana

data/movements/movements.xml
Lua:
    <movevent event="Equip" itemid="YourRingID" slot="ring" script="YourScriptName.lua" />
    <movevent event="DeEquip" itemid="YourRingID" slot="ring" script="YourScriptName.lua" />

data/movements/YourScriptName.lua
Lua:
local config = {
    outfit = 104,
    effect = 12, -- Effect on equip and deequip
    distanceeffect = 36, -- Distance effect on equip and deequip
    distanceeffectaura = 36, -- Distance effect aura
    -- animation means how fast the aura should go around the player so 500 = 0.5 sec, 1 sec = 1000
    animation = 500
}  

-- Do not change the ticks or sub ids if you don't know how to do that :D
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, -1)
condition:setParameter(CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 120)
condition:setParameter(CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, 120)
condition:setParameter(CONDITION_PARAM_SUBID, 1)

-- Do not change the ticks or sub ids if you don't know how to do that :D
local condition2 = Condition(CONDITION_OUTFIT)
condition2:setParameter(CONDITION_PARAM_TICKS, -1)
condition2:setOutfit({lookType = config.outfit})
condition2:setParameter(CONDITION_PARAM_SUBID, 1)

function RingAura(cid)
    local player = Player(cid)
    if player then
        local pos = player:getPosition()
        Position(pos.x, pos.y+1, pos.z):sendDistanceEffect(Position(pos.x-1, pos.y, pos.z), config.distanceeffectaura)      
        Position(pos.x-1, pos.y, pos.z):sendDistanceEffect(Position(pos.x, pos.y-1, pos.z), config.distanceeffectaura)
        Position(pos.x, pos.y-1, pos.z):sendDistanceEffect(Position(pos.x+1, pos.y, pos.z), config.distanceeffectaura)
        Position(pos.x+1, pos.y, pos.z):sendDistanceEffect(Position(pos.x, pos.y+1, pos.z), config.distanceeffectaura)
        effect = addEvent(RingAura, 1 * config.animation, cid)
    else
        effect = nil
    end
end

function onEquip(player, item, slot, isCheck)
    if isCheck then
        return true
    end
    local pos = player:getPosition()
    player:addCondition(condition)
    player:addCondition(condition2)
    pos:sendMagicEffect(config.effect)
    player:say('ACTIVATED', TALKTYPE_MONSTER_SAY)
    Position(pos.x+1, pos.y+1, pos.z):sendDistanceEffect(pos, config.distanceeffect)
    Position(pos.x+1, pos.y-1, pos.z):sendDistanceEffect(pos, config.distanceeffect)
    Position(pos.x-1, pos.y-1, pos.z):sendDistanceEffect(pos, config.distanceeffect)
    Position(pos.x-1, pos.y+1, pos.z):sendDistanceEffect(pos, config.distanceeffect)
    effect = addEvent(RingAura, 1 * 1000, player:getId())
end

function onDeEquip(player, item, slot)
    local pos = player:getPosition()
    pos:sendMagicEffect(config.effect)
    pos:sendDistanceEffect(Position(pos.x+1, pos.y+1, pos.z), config.distanceeffect)
    pos:sendDistanceEffect(Position(pos.x+1, pos.y-1, pos.z), config.distanceeffect)
    pos:sendDistanceEffect(Position(pos.x-1, pos.y-1, pos.z), config.distanceeffect)
    pos:sendDistanceEffect(Position(pos.x-1, pos.y+1, pos.z), config.distanceeffect)
    player:say('DEACTIVATED', TALKTYPE_MONSTER_SAY)
    stopEvent(effect)
    player:removeCondition(CONDITION_ATTRIBUTES, condition, 1)
    player:removeCondition(CONDITION_OUTFIT, condition2, 1)
    return true
end
@Levi999x Can you do that when you have it, remove x amount of gold coins?
 
edit line 25
if player then <-- ( idk why I added this tho
to
if player:removeMoney(yourMoney) then

@nefinoo
i will create in some days a better script for it
the player:removeMoney was just a simple/noobish solution
 
Last edited:
@Levi999x ,

hey, question, so if like 100 people use the ring it can realy lag up serrver i guess, right ? because of the effects ?
 
@Levi999x ,

hey, question, so if like 100 people use the ring it can realy lag up serrver i guess, right ? because of the effects ?
not because of the effects, but because of addEvent maybe, but probably no, unless your server computer is really really poor
 
Preview:

Ring gives you custom outfit, custom aura effect + 20% extra health & mana

data/movements/movements.xml
Lua:
    <movevent event="Equip" itemid="YourRingID" slot="ring" script="YourScriptName.lua" />
    <movevent event="DeEquip" itemid="YourRingID" slot="ring" script="YourScriptName.lua" />

data/movements/YourScriptName.lua
Lua:
local config = {
    outfit = 104,
    effect = 12, -- Effect on equip and deequip
    distanceeffect = 36, -- Distance effect on equip and deequip
    distanceeffectaura = 36, -- Distance effect aura
    -- animation means how fast the aura should go around the player so 500 = 0.5 sec, 1 sec = 1000
    animation = 500
}  

-- Do not change the ticks or sub ids if you don't know how to do that :D
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, -1)
condition:setParameter(CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 120)
condition:setParameter(CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, 120)
condition:setParameter(CONDITION_PARAM_SUBID, 1)

-- Do not change the ticks or sub ids if you don't know how to do that :D
local condition2 = Condition(CONDITION_OUTFIT)
condition2:setParameter(CONDITION_PARAM_TICKS, -1)
condition2:setOutfit({lookType = config.outfit})
condition2:setParameter(CONDITION_PARAM_SUBID, 1)

function RingAura(cid)
    local player = Player(cid)
    if player then
        local pos = player:getPosition()
        Position(pos.x, pos.y+1, pos.z):sendDistanceEffect(Position(pos.x-1, pos.y, pos.z), config.distanceeffectaura)      
        Position(pos.x-1, pos.y, pos.z):sendDistanceEffect(Position(pos.x, pos.y-1, pos.z), config.distanceeffectaura)
        Position(pos.x, pos.y-1, pos.z):sendDistanceEffect(Position(pos.x+1, pos.y, pos.z), config.distanceeffectaura)
        Position(pos.x+1, pos.y, pos.z):sendDistanceEffect(Position(pos.x, pos.y+1, pos.z), config.distanceeffectaura)
        effect = addEvent(RingAura, 1 * config.animation, cid)
    else
        effect = nil
    end
end

function onEquip(player, item, slot, isCheck)
    if isCheck then
        return true
    end
    local pos = player:getPosition()
    player:addCondition(condition)
    player:addCondition(condition2)
    pos:sendMagicEffect(config.effect)
    player:say('ACTIVATED', TALKTYPE_MONSTER_SAY)
    Position(pos.x+1, pos.y+1, pos.z):sendDistanceEffect(pos, config.distanceeffect)
    Position(pos.x+1, pos.y-1, pos.z):sendDistanceEffect(pos, config.distanceeffect)
    Position(pos.x-1, pos.y-1, pos.z):sendDistanceEffect(pos, config.distanceeffect)
    Position(pos.x-1, pos.y+1, pos.z):sendDistanceEffect(pos, config.distanceeffect)
    effect = addEvent(RingAura, 1 * 1000, player:getId())
end

function onDeEquip(player, item, slot)
    local pos = player:getPosition()
    pos:sendMagicEffect(config.effect)
    pos:sendDistanceEffect(Position(pos.x+1, pos.y+1, pos.z), config.distanceeffect)
    pos:sendDistanceEffect(Position(pos.x+1, pos.y-1, pos.z), config.distanceeffect)
    pos:sendDistanceEffect(Position(pos.x-1, pos.y-1, pos.z), config.distanceeffect)
    pos:sendDistanceEffect(Position(pos.x-1, pos.y+1, pos.z), config.distanceeffect)
    player:say('DEACTIVATED', TALKTYPE_MONSTER_SAY)
    stopEvent(effect)
    player:removeCondition(CONDITION_ATTRIBUTES, condition, 1)
    player:removeCondition(CONDITION_OUTFIT, condition2, 1)
    return true
end
Nice Script i like it!

Ps: There is a possibility to multiply this script in order to use it in different items at same time ?
Tested: 2x rings, one effects ( all 31 ) second, effects ( all 30 ) , it shows on the 2 items the effects of the first script ( 31 ) in both items.
 
Back
Top