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

Arrow has 50% to break when used with "bow"

adamox223

New Member
Joined
Oct 21, 2017
Messages
99
Reaction score
4
Hello, can you add in this code break chance 50% for item: 2544? because i try but only errors xd

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 2)

function onGetFormulaValues(cid, level, skill, attack, factor)
     local min = 0.6 * (attack * skill + level)
     local max = 0.8 * (attack * skill + level)
     return -min, -max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onUseWeapon(cid, var)
    if getPlayerSlotItem(cid, 10).itemid == 2544 then
        doRemoveItem(getPlayerSlotItem(cid, 10).uid, 1)
        doCombat(cid, combat, var)
    else
        doPlayerSendCancel(cid, 'You need arrow to use this shooting glove.')
    end
end
 
Would it be suitable to just edit the arrow in items.xml, so it looks more likes spears?

XML:
<item id="2389" article="a" name="spear" plural="spears">
        <attribute key="weight" value="2000"/>
        <attribute key="attack" value="25"/>
        <attribute key="weaponType" value="distance"/>
        <attribute key="shootType" value="spear"/>
        <attribute key="range" value="3"/>
        <attribute key="breakChance" value="0"/>
        <attribute key="ammoAction" value="move"/>
    </item>

Above is spears, and below is arrows, perhaps you can put the breakchance in arrows, but not sure where happens to removecount if you do not take it out.

XML:
<item id="2544" article="an" name="arrow" plural="arrows">
        <attribute key="weight" value="70"/>
        <attribute key="slotType" value="ammo"/>
        <attribute key="attack" value="25"/>
        <attribute key="weaponType" value="ammunition"/>
        <attribute key="ammoType" value="arrow"/>
        <attribute key="shootType" value="arrow"/>
        <attribute key="maxHitChance" value="90"/>
        <attribute key="ammoAction" value="removecount"/>
    </item>


Good luck!
 

Similar threads

Back
Top