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

simple script? (moveevents)

okaay, it simple, i'm making an assassin vocation and it use one hand swords with "dualwield" attr, and i want other vocations dont equip the second sword on shield slot, only assassin can

assassin> \o/
knight> \oX "you can't"
 
ohh alright,
is in items.xml or vocation.xml i dont remember, only add atribute;
Code:
                <attribute key="dualwield" value="1"/>

and in movements edited the movements.xml on the only X vocation can use the item.
example;
Code:
  <movevent type="DeEquip" itemid="7891" slot="feet" event="function" value="onDeEquipItem"/>
   <movevent type="Equip" itemid="7893" slot="feet" event="function" value="onEquipItem">
     <vocation id="1"/>
     <vocation id="5" showInDescription="0"/>
     <vocation id="2"/>
     <vocation id="6" showInDescription="0"/>
   </movevent>
 
i know these steps, it doesnt work in moveevents like i want.
Ex:
<movevent type="Equip" itemid="KATANA" slot="shield" event="function" value="onEquipItem">
<vocation id="x"/>

with this method ONLY assassin will be capable to equip a katana and knight no, i want the other vocations equip katana too, understand?

sry for bad english xD
 
Code:
<movevent type="Equip" itemid="KATANA" slot="shield" event="function" value="onEquipItem"/>

Just like that??
 
Sooo if i get u right, if he is an for example a knight he can only equip one but if he is an assassin he can equip 2?
 
I am having same issue you have, my idea to solve it is to edit the items.otb and make copies of the items and rename them so that only that voc can use it, so say throwing stars copied to make ninja throwing stars... anyways another way is to script it in .lua with movements
 
Try this... Try going to your movements/scripts folder and make dualweild.lua

Code:
function onEquip(cid, item, slot)
  if if(getPlayerVocation(cid)) == 1 then
    doItemSetAttribute(itemEx.uid, "dualwield", 1)
  end
return true
end

function onDeEquip(cid, item, slot)
  if if(getPlayerVocation(cid)) == 1 then
    doItemSetAttribute(itemEx.uid, "dualwield", -1)
  end
return true
end

Then add to movements.xml like this

Code:
<movevent type="Equip" itemid="XXXX" slot="XXXXX" level="XXX" event="script" value="dualweild.lua"/>
<movevent type="DeEquip" itemid="XXXX" slot="XXXXX" level="XXX" event="script" value="dualweild.lua"/>
 
Back
Top