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

Mage sword

Sir MoX

New Member
Joined
Jan 14, 2009
Messages
285
Reaction score
1
Hi, I would like to have in my new server a sword for sorcerers and druids that its similar to the fire sword of the nights the only difference that throw energy and the power of the energy increase with magic and the hits with melee increase with sword fighting =)I dont know if the last thing its easy so thats why I didnt do it, if someone can do it for me or just give me an advice i will rep++ her =) the sword if i would like to use is 7391
 
Last edited:
Okay, I did it, but it doesn't attack as a sword, so you only get magic level up.

So...

In the \data\weapons\weapons.xml remove:

<melee id="7391" level="50" unproperly="1" event="function" value="default"/>

and add:

<wand id="7391" level="50" mana="20" range="3" event="script" value="sword.lua"> <!-- Thaian Sword-->
<vocation id="1"/>
<vocation id="2"/>
<vocation id="5" showInDescription="0"/>
<vocation id="6" showInDescription="0"/>
</wand>

In the \data\weapons\scripts\

add a .lua named sword.lua and paste this:

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end

then in \data\items\items.xml change:

<item id="7391" article="a" name="Thaian sword">
<attribute key="weight" value="6100"/>
<attribute key="defense" value="29"/>
<attribute key="attack" value="45"/>
<attribute key="weaponType" value="sword"/>
<attribute key="slotType" value="two-handed"/>
</item>

for:

<item id="7391" article="a" name="thaian sword">
<attribute key="weight" value="6100" />
<attribute key="weaponType" value="wand" />
<attribute key="range" value="3" />
</item>

It worked for me in TFS 0.3.6pl1 (Crying Damson). I hope it helps you too! Rep++ would be nice :D

P.S. You can edit the range you want for this weapon and also the mana cost for it.
 
Last edited:
I test it and its okay thanks ;D but i have a question: how can i do to make the mage sword atack melee like fire sword?
 
Last edited:
I think this should work for you.. If it don't PM me and I'll give it another try
In the \data\weapons\weapons.xml change this
PHP:
<melee id="7391" level="50" unproperly="1" event="function" value="default"/>

to
PHP:
<melee id="7391" level="50" mana="20" range="3" unproperly="1" event="script" value="sword.lua">
    <vocation id="1"/>
    <vocation id="2"/>
</melee>

/data/weapons/scripts/sword.lua
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end

make sure
\data\items\items.xml has this
PHP:
<item id="7391" article="a" name="Thaian sword">
<attribute key="weight" value="6100"/>
<attribute key="defense" value="29"/>
<attribute key="attack" value="45"/>
<attribute key="weaponType" value="sword"/>
<attribute key="slotType" value="two-handed"/>
</item>
 
Back
Top