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

Solved Help with arrow script

Kubus93

New Member
Joined
Oct 14, 2014
Messages
29
Reaction score
1
Hi
How can I to set script that arrows deal damage to a certain limit?
I mean that damage will increase with the level and skills but do not have to damage one another too much difference, for example: at 100 level 600-750hp and not as now from 7-1400hp. In short, so it was not such a large difference between the maximum and minimum injury. I think I described it well.

c arrow.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SHIVERARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 7, 0, 1, 0)

local condition = createConditionObject(CONDITION_ENERGY)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 4, 1000, -200)
setCombatCondition(combat, condition)

local condition = createConditionObject(CONDITION_ENERGY)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 3, 1000, -125)
setCombatCondition(combat, condition)

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

weapons.xml
Code:
<distance id="2352" level="8" range="8" enabled="1" exhaustion="0" hitchance="100" ammo="removecount" script="crystal.lua">
        <vocation id="3"/>
        <vocation id="7" showInDescription="0"/>
    </distance>

items.xml
Code:
</item>
            <item id="2352" article="a" name="crystal arrow" plural="crystal arrow">
        <attribute key="weight" value="80"/>
        <attribute key="slotType" value="ammo"/>
        <attribute key="hitChance" value="100" />
        <attribute key="attack" value="105" />
        <attribute key="weaponType" value="ammunition"/>
        <attribute key="ammoType" value="arrow"/>
        <attribute key="shootType" value="arrow"/>
    </item>
 
Last edited:
Skill is not necessary , the most important level added to damage. When i set 0.08 for 10.0 rise dmg
and was the same regardless of skill or level
 
How much extra damage should it add? If someone is for example level 100, that x 2 = 200, that x 0.08 = 16 extra damage for level, someone level 8 will have 1 extra damage.
If it should be more, you can just do level * 10 for example. 100 x 10 = 1000 x 0.08 = 80 extra damage, on level 8 it will be 6 extra damage then.
 
Still not. It look that now. If u can change it only for level without skill, rise with lvl only this is important for me
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SHIVERARROW)
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")


local condition = createConditionObject(CONDITION_ENERGY)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 4, 1000, -200)
setCombatCondition(combat, condition)

local condition = createConditionObject(CONDITION_ENERGY)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 3, 1000, -125)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end
 
Post the changes with the lvl influence you made.

If there is something wrong with the parameter level on your server, you can also use getPlayerLevel(cid) instead of level.
 
Back
Top