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

Lua Help to change formula wands

dudie

Member
Joined
May 23, 2016
Messages
128
Reaction score
12
I want make a new formula attack wand to make others system...
Someone could help me? Whats i made worng?

weapons.xml
Code:
  <wand id="2190" mana="2" type="energy" event="function" value="wands.lua"> <!-- Wand of Vortex -->
     <vocation id="1"/>
   </wand>

weapons/wands.lua
Code:
function onGetFormulaValues(cid, level, skill, attack, factor)
   min = (attack * 5.0) * -1
   max = (attack * 8.0) * -1
   return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")


items.xml
Code:
  <item id="2190" article="a" name="wand of vortex">
     <attribute key="description" value="Surges of energy rush through the tip of this wand." />
     <attribute key="weight" value="1900" />
     <attribute key="weaponType" value="wand" />
     <attribute key="shootType" value="energy" />
     <attribute key="range" value="3" />
     <attribute key="attack" value="1"/>
   </item>
 
@dudie the only source i found in github for 0.4 3777 was this one > https://github.com/laerciosant/TFS-0.4-DEV, and this sources has source edits so i dont know how far this code match with your, try to find this:
line 845 of item.cpp and replace this
Code:
else if(it.weaponType != WEAPON_AMMO && it.weaponType != WEAPON_WAND)
to
Code:
else if(it.weaponType != WEAPON_AMMO)
if you can't found this just upload your item.cpp (not items.cpp) and item.h, let me know the results =)
 
@Zothion sources seens better here, whatever, on tfs 1.2 its already possible without any source change.
https://i.imgur.com/tgOmLAM.jpg
Code:
<item id="2190" article="a" name="wand of vortex">
        <attribute key="description" value="Surges of energy rush through the tip of this wand." />
        <attribute key="weight" value="1900" />
        <attribute key="attack" value="1" />
        <attribute key="weaponType" value="wand" />
        <attribute key="shootType" value="energy" />
        <attribute key="range" value="3" />
    </item>
tho its 1 line source edit, there is no problem.
 
@dudie the only source i found in github for 0.4 3777 was this one > https://github.com/laerciosant/TFS-0.4-DEV, and this sources has source edits so i dont know how far this code match with your, try to find this:
line 845 of item.cpp and replace this
Code:
else if(it.weaponType != WEAPON_AMMO && it.weaponType != WEAPON_WAND)
to
Code:
else if(it.weaponType != WEAPON_AMMO)
if you can't found this just upload your item.cpp (not items.cpp) and item.h, let me know the results =)

Ty so much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I think its the last ask...
There is a way to detect if item is a wand by this funcion:
getItemWeaponType

for exemple
Code:
return ((weaponType > 0 and weaponType < 7) or self.item.armor ~= 0)
What id is wand id?
 
Back
Top