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

Rod/Wand does no damage

2057623

Member
Joined
Jan 16, 2012
Messages
97
Reaction score
12
Me again asking for help for any of you kk, well as the name of the topic already says, rod and wand does not do damage, but it is not doing damage because I added a code "Wand / Rod Elemental" but the Wand it is not doing damage, and not changing element. My server is TFS 1.4x 10.98, in the topic it says it was 1.x+ but with me it didn't work if someone can help me I'm grateful.

local damage = { --Ataque mínino e ataque máximo
min = 200,
max = 600
}

local effects = {
[1] = {effect = 36, shootEffect = 3, damageEffect = COMBAT_FIREDAMAGE},
[2] = {effect = 52, shootEffect = 28, damageEffect = COMBAT_ICEDAMAGE},
[3] = {effect = 46, shootEffect = 29, damageEffect = COMBAT_POISONDAMAGE},
[4] = {effect = 17, shootEffect = 31, damageEffect = COMBAT_DEATHDAMAGE},
[5] = {effect = 47, shootEffect = 35, damageEffect = COMBAT_ENERGYDAMAGE},
[6] = {effect = 31, shootEffect = 40, damageEffect = COMBAT_PHYSICALDAMAGE},
[7] = {effect = 49, shootEffect = 37, damageEffect = COMBAT_HOLYDAMAGE}
}

function onUseWeapon(player, variant)
local effect, target = player:getStorageValue(4561), player:getTarget()
if target then
local random = effects[effect] or effects[math.random(#effects)]
player:getPosition():sendDistanceEffect(target:getPosition(), random.shootEffect)
addEvent(doAreaCombatHealth, 100, player, random.damageEffect, target:getPosition(), 0, -damage.min, -damage.max, random.effect)
end
return true
end

<wand id="26483" level="100" mana="35" event="script" value="rod donate.lua">
<vocation name="Druid" />
<vocation name="Sorcerer" />
<vocation name="Elder Druid" />
<vocation name="Master Sorcerer" />
</wand>

<item id="26483" article="a" name="Arcanum Celeste Rod">
<attribute key="weight" value="3700" />
<attribute key="weaponType" value="wand" />
<attribute key="shootType" value="smallholy" />
<attribute key="range" value="5" />
<attribute key="magiclevelpoints" value="15" />
</item>

The first code is for the elemental wand effect, and the ones below are the settings. can anyone help
 
Solution
Lua:
local damage = {
    min = 200,
    max = 600
}

local effects = {
    [1] = {effect = 36, shootEffect = 3, damageEffect = COMBAT_FIREDAMAGE},
    [2] = {effect = 52, shootEffect = 28, damageEffect = COMBAT_ICEDAMAGE},
    [3] = {effect = 46, shootEffect = 29, damageEffect = COMBAT_POISONDAMAGE},
    [4] = {effect = 17, shootEffect = 31, damageEffect = COMBAT_DEATHDAMAGE},
    [5] = {effect = 47, shootEffect = 35, damageEffect = COMBAT_ENERGYDAMAGE},
    [6] = {effect = 31, shootEffect = 40, damageEffect = COMBAT_PHYSICALDAMAGE},
    [7] = {effect = 49, shootEffect = 37, damageEffect = COMBAT_HOLYDAMAGE}
}

function onUseWeapon(player, variant)
    local effect, target = player:getStorageValue(4561), player:getTarget()
    if target...
Lua:
local damage = {
    min = 200,
    max = 600
}

local effects = {
    [1] = {effect = 36, shootEffect = 3, damageEffect = COMBAT_FIREDAMAGE},
    [2] = {effect = 52, shootEffect = 28, damageEffect = COMBAT_ICEDAMAGE},
    [3] = {effect = 46, shootEffect = 29, damageEffect = COMBAT_POISONDAMAGE},
    [4] = {effect = 17, shootEffect = 31, damageEffect = COMBAT_DEATHDAMAGE},
    [5] = {effect = 47, shootEffect = 35, damageEffect = COMBAT_ENERGYDAMAGE},
    [6] = {effect = 31, shootEffect = 40, damageEffect = COMBAT_PHYSICALDAMAGE},
    [7] = {effect = 49, shootEffect = 37, damageEffect = COMBAT_HOLYDAMAGE}
}

function onUseWeapon(player, variant)
    local effect, target = player:getStorageValue(4561), player:getTarget()
    if target then
        local random = effects[effect] or effects[math.random(#effects)]
        player:getPosition():sendDistanceEffect(target:getPosition(), random.shootEffect)
        doAreaCombatHealth(player:getId(), random.damageEffect, target:getPosition(), 0, -damage.min, -damage.max, random.effect)
    end
    return true
end
Lua:
<wand id="26483" range="7" lvl="100" mana="35" enabled="1" exhaustion="0" script="rod donate.lua">   <!-- rod donate -->
        <vocation name="Elder Druid" />
        <vocation name="Master Sorcerer" />
     
</wand>

In the XML that I saw, which contained 'value' and 'event', this structure was only present in the TFS 0.4 version. From now on, it is necessary to use the term 'script' in place of 'value' and 'event'.
 
Last edited:
Solution
Lua:
local damage = {
    min = 200,
    max = 600
}

local effects = {
    [1] = {effect = 36, shootEffect = 3, damageEffect = COMBAT_FIREDAMAGE},
    [2] = {effect = 52, shootEffect = 28, damageEffect = COMBAT_ICEDAMAGE},
    [3] = {effect = 46, shootEffect = 29, damageEffect = COMBAT_POISONDAMAGE},
    [4] = {effect = 17, shootEffect = 31, damageEffect = COMBAT_DEATHDAMAGE},
    [5] = {effect = 47, shootEffect = 35, damageEffect = COMBAT_ENERGYDAMAGE},
    [6] = {effect = 31, shootEffect = 40, damageEffect = COMBAT_PHYSICALDAMAGE},
    [7] = {effect = 49, shootEffect = 37, damageEffect = COMBAT_HOLYDAMAGE}
}

function onUseWeapon(player, variant)
    local effect, target = player:getStorageValue(4561), player:getTarget()
    if target then
        local random = effects[effect] or effects[math.random(#effects)]
        player:getPosition():sendDistanceEffect(target:getPosition(), random.shootEffect)
        doAreaCombatHealth(player:getId(), random.damageEffect, target:getPosition(), 0, -damage.min, -damage.max, random.effect)
    end
    return true
end
Lua:
<wand id="26483" range="7" lvl="100" mana="35" enabled="1" exhaustion="0" script="rod donate.lua">   <!-- rod donate -->
        <vocation name="Elder Druid" />
        <vocation name="Master Sorcerer" />
       
</wand>
It remains the same, the effect goes towards the monster, but only holly something like that comes out, but it does not damage the monster
 
Back
Top