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

Combination Two Handed Item with shield

alvaro007

New Member
Joined
Jun 15, 2012
Messages
35
Reaction score
2
Hi Community of otland, we want to ask that if someone know to how doing on my ot how can i combinate a two handed item with shield but through script, only to remove the slottype through script not through items.xml
 
Solution
You can do it with movements perfectly, you only need conditions.
Friend if you can not understand what the boy wants, then do not say it's possible. because that is not true.
It's not about 2 articles.
it is about that all items have to meet the conditions and interact with the weapon.
if you do it with only 1 code, nothing will prevent the item from being used regardless of the weapon, unless it has a code with such conditions.
what specific reason makes you need it through a script?
what's the point of a script mimicking a weapon being one handed instead of just making it one handed?
 
what specific reason makes you need it through a script?
what's the point of a script mimicking a weapon being one handed instead of just making it one handed?

My specific reason is that i would want to do that a specific Skill Shield of player, for example 55, all the wepaons that slottype was two handed be removed and transform it all this weapon in a weapon of one hand to can combinate with a shield, but before if you are Skill Shield < 55 all weapons of slottype two handed continue being weapon of two handed, its my idea of my script and i know to do the script but i dont know a subfunction that remove two-handed slottype, for this reason, i came here to ask for help

Thank You
 
Oh!
He wants the script to check the shielding skill of the player, and check that the weapon they are holding is a two handed weapon.
If the shielding check goes through, and the two handed weapon check goes through, then do something.

I'd probably just make an array of all two handed weapons with a custom function.
annd a quick search found someone that's done the same thing.
Just add whatever it missing.
Lua - How to check if an item is two-handed or not
 
I did a script like this, but i dont know which have to put into this box (----). because the key is slottype, but the value es two-handed, not true or false, then i cant do function this script:

Lua:
function onEquip(cid, item, slot)
  if getPlayerSkill(cid, SKILL_SHIELD) >= 55 then

    doItemSetAttribute(item.uid, '-----', true)
  
  
    else
    doItemSetAttribute(item.uid, '-----', false)
  
    end

return true

end
function onDeEquip(cid, item, slot)

    doItemSetAttribute(item.uid, '-----', true)

return true

end
 
Lua:
         ITEM_ATTRIBUTE_NONE     
         ITEM_ATTRIBUTE_ACTIONID     
         ITEM_ATTRIBUTE_UNIQUEID     
         ITEM_ATTRIBUTE_DESCRIPTION     
         ITEM_ATTRIBUTE_TEXT     
         ITEM_ATTRIBUTE_DATE     
         ITEM_ATTRIBUTE_WRITER     
         ITEM_ATTRIBUTE_NAME     
         ITEM_ATTRIBUTE_ARTICLE     
         ITEM_ATTRIBUTE_PLURALNAME     
         ITEM_ATTRIBUTE_WEIGHT     
         ITEM_ATTRIBUTE_ATTACK     
         ITEM_ATTRIBUTE_DEFENSE     
         ITEM_ATTRIBUTE_EXTRADEFENSE     
         ITEM_ATTRIBUTE_ARMOR     
         ITEM_ATTRIBUTE_HITCHANCE     
         ITEM_ATTRIBUTE_SHOOTRANGE     
         ITEM_ATTRIBUTE_OWNER     
         ITEM_ATTRIBUTE_DURATION     
         ITEM_ATTRIBUTE_DECAYSTATE     
         ITEM_ATTRIBUTE_CORPSEOWNER     
         ITEM_ATTRIBUTE_CHARGES     
         ITEM_ATTRIBUTE_FLUIDTYPE     
         ITEM_ATTRIBUTE_DOORID
you only have these options.
What you are looking for does not exist in your sources.
 
Im searching a custom function or edit source to can do that two handed weapon can be combinated with a shield a specific skill shield level, because not exist attributte two handed, because is a slot type
 
Its way easier if you think a bit out of the box.

For example: You create a weapon onehanded.

Create a movevent for onEquip that check this:

Code:
If player:getStorageValue(storage) == 1 or player:getVocation() == vocation then
   return true -- This means that you will be able to equip the weapon normally if you have the storage or the correct vocation.
else
   if player:getSlotItem(CONST_SLOT_LEFT) or player:getSlotItem(CONST_SLOT_RIGHT) then --- if the player doesnt have the storage, and already has one of the hands busy, it wont be able to equip. Meaning it will work as a two-handed.
      player:sendCancelMessage('You need both hands free to equip this.')
   else
     return true
   end
end

Hope it helps.

~Aeronx
 
I did this script with your idea but dont found, when i equip the weapon since backpack, the player equip the weapon and return this message "You need both hands free to equip this.", but i can equip the weapon, the script is this:

Lua:
function onEquip(cid, item, slot)

if getPlayerSkillLevel(cid, SKILL_SHIELD) >= 55 then

   return true

elseif (getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == 0 and getPlayerSlotItem(cid,CONST_SLOT_RIGHT).itemid == 2393) or (getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == 2393 and getPlayerSlotItem(cid,CONST_SLOT_RIGHT).itemid == 0) then

    return true

elseif (getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid ~= 0 and getPlayerSlotItem(cid,CONST_SLOT_RIGHT).itemid == 2393) or (getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == 2393 and getPlayerSlotItem(cid,CONST_SLOT_RIGHT).itemid ~= 0) then

   doPlayerSendCancel(cid, 'You need both hands free to equip this.')

end
return true
end

What have i write to can cancel equip the weapon.
 
wtf.. you are messing things up and its not needed.

Code:
if getPlayerSlotItem(cid, CONST_SLOT_LEFT) then
  weapon = getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid
elseif getPlayerSlotItem(cid, CONST_SLOT_RIGHT) then
  weapon = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid
elseif weapon == 2392 and getPlayerSkillLevel(cid, SKILL_SHIELD) >= 55  then
  return true
else
   if getPlayerSkillLevel(cid, SKILL_SHIELD) < 55 then
       doPlayerSendCancel(cid, 'You need 55 shielding skill to equip this')
   return false
   end
   if weapon ~= 2392 then
      doPlayerSendCancel(cid, 'You need both hands free to equip this.')
      return false
   end
end
 
Not found

wtf.. you are messing things up and its not needed.

Code:
if getPlayerSlotItem(cid, CONST_SLOT_LEFT) then
  weapon = getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid
elseif getPlayerSlotItem(cid, CONST_SLOT_RIGHT) then
  weapon = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid
elseif weapon == 2392 and getPlayerSkillLevel(cid, SKILL_SHIELD) >= 55  then
  return true
else
   if getPlayerSkillLevel(cid, SKILL_SHIELD) < 55 then
       doPlayerSendCancel(cid, 'You need 55 shielding skill to equip this')
   return false
   end
   if weapon ~= 2392 then
      doPlayerSendCancel(cid, 'You need both hands free to equip this.')
      return false
   end
end
 
not found? not found what? >.<

Explain youserlf better, or use google traductor. Post the error. otherwise i wont be able to help you.
 
I havent got error, only when i equip the weapon, return the sendcancel but i can continue to equip the weapon. All script found but this part of script

Lua:
[LIST=1]
[*]if weapon ~= 2393 then
[*]      doPlayerSendCancel(cid, 'You need both hands free to equip this.')
[*]      return false
[*]   end
[/LIST]

Dont work, because when i equip the weapon, return the send cancel but i can continue to equip the weapon and shouldnt equip weapon
 
I havent got error, only when i equip the weapon, return the sendcancel but i can continue to equip the weapon. All script found but this part of script

Lua:
[LIST=1]
[*]if weapon ~= 2393 then
[*]      doPlayerSendCancel(cid, 'You need both hands free to equip this.')
[*]      return false
[*]   end
[/LIST]

Dont work, because when i equip the weapon, return the send cancel but i can continue to equip the weapon and shouldnt equip weapon
Are you soure you updated the script? With return false, you should not be able to equip and item
 
Sure see:

Code:
function onEquip(cid, item, slot)
if getPlayerSlotItem(cid, CONST_SLOT_LEFT) then
  weapon = getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid
elseif getPlayerSlotItem(cid, CONST_SLOT_RIGHT) then
  weapon = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid
elseif weapon == 2392 and getPlayerSkillLevel(cid, SKILL_SHIELD) >= 55  then
  return true
else
   if getPlayerSkillLevel(cid, SKILL_SHIELD) < 55 then
       doPlayerSendCancel(cid, 'You need 55 shielding skill to equip this')
   return false
   end
   if weapon ~= 2392 then
      doPlayerSendCancel(cid, 'You need both hands free to equip this.')
      return false
   end
return true
end
 
Back
Top