I made this script with help to you from forum to new damage system
weapons/scripts/distance_damage.lua
It's work fine to royal spears for exemple... print fine (35)
Assassin star print 65, fine work too
But bows and arrows i have a problem...
I want attack be arrow attack + bow attack
Using bow
print only 30 and not 31
I want print bow atk + arrow atk
For exemple if bow is attack 20 and arrow is attack 30...
Total attack on script is 50
weapons.xml
weapons/scripts/distance_damage.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
function onGetFormulaValues(cid, level, skill, attack, factor)
--min = ((0.08) * (attack) * (skill)) * -1
--max = ((0.08) * (attack) * (skill)) * -1
--print(skill)
print(attack)
min = ((attack) * (100)) * -1
max = ((attack) * (100)) * -1
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end
It's work fine to royal spears for exemple... print fine (35)
Assassin star print 65, fine work too
But bows and arrows i have a problem...
I want attack be arrow attack + bow attack
Using bow
Code:
16:44 You see a bow (Range:6, Atk +1).
It weighs 31.00 oz.
ItemID: [2456].
Code:
<item id="2544" article="an" name="arrow" plural="arrows">
<attribute key="weight" value="10" />
<attribute key="slotType" value="ammo" />
<attribute key="attack" value="30" />
<attribute key="maxHitChance" value="90" />
<attribute key="weaponType" value="ammunition" />
<attribute key="ammoType" value="arrow" />
<attribute key="shootType" value="arrow" />
<attribute key="ammoAction" value="removecount" />
</item>
print only 30 and not 31
I want print bow atk + arrow atk
For exemple if bow is attack 20 and arrow is attack 30...
Total attack on script is 50
weapons.xml
Code:
<!-- mage & paladin -->
<distance id="2456" unproperly="1" swing="true" event="script" value="distance_damage.lua" /> <!-- bow -->
<!-- paladin -->
<distance id="2455" unproperly="1" swing="true" event="script" value="distance_damage.lua"> <!-- crossbow -->
<vocation id="3"/>
<vocation id="7" showInDescription="0"/>
<vocation id="11" showInDescription="0"/>
</distance>
<distance id="7438" unproperly="1" swing="true" event="script" value="distance_damage.lua"> <!-- elvish bow -->
<vocation id="3"/>
<vocation id="7" showInDescription="0"/>
<vocation id="11" showInDescription="0"/>
</distance>
<distance id="5803" unproperly="1" swing="true" event="script" value="distance_damage.lua" /> <!-- arbalest -->
<distance id="5907" unproperly="1" swing="true" event="script" value="distance_damage.lua" /> <!-- slingshot -->
<distance id="1294" unproperly="1" swing="true" event="script" value="distance_damage.lua" /> <!-- small stone -->
<distance id="8849" unproperly="1" swing="true" event="function" value="default"> <!-- Modified Crossbow -->
<vocation id="3"/>
<vocation id="7" showInDescription="0"/>
<vocation id="11" showInDescription="0"/>
</distance>
<distance id="8850" unproperly="1" swing="true" event="function" value="default"> <!-- Chain Bolter -->
<vocation id="3"/>
<vocation id="7" showInDescription="0"/>
<vocation id="11" showInDescription="0"/>
</distance>
<distance id="8853" unproperly="1" swing="true" event="function" value="default"> <!-- Ironworker -->
<vocation id="3"/>
<vocation id="7" showInDescription="0"/>
<vocation id="11" showInDescription="0"/>
</distance>
<distance id="8852" unproperly="1" swing="true" event="function" value="default"> <!-- Devileye -->
<vocation id="3"/>
<vocation id="7" showInDescription="0"/>
<vocation id="11" showInDescription="0"/>
</distance>
<distance id="8851" unproperly="1" swing="true" event="function" value="default"> <!-- Royal Crossbow -->
<vocation id="3"/>
<vocation id="7" showInDescription="0"/>
<vocation id="11" showInDescription="0"/>
</distance>
<distance id="8857" unproperly="1" swing="true" event="function" value="default"> <!-- Silkweaver Bow -->
<vocation id="3"/>
<vocation id="7" showInDescription="0"/>
<vocation id="11" showInDescription="0"/>
</distance>
<distance id="8855" unproperly="1" swing="true" event="function" value="default"> <!-- Composite Hornbow -->
<vocation id="3"/>
<vocation id="7" showInDescription="0"/>
<vocation id="11" showInDescription="0"/>
</distance>
<distance id="8858" unproperly="1" swing="true" event="function" value="default"> <!-- Elethriel's Elemental Bow -->
<vocation id="3"/>
<vocation id="7" showInDescription="0"/>
<vocation id="11" showInDescription="0"/>
</distance>
<distance id="8854" unproperly="1" swing="true" event="function" value="default"> <!-- Warsinger Bow -->
<vocation id="3"/>
<vocation id="7" showInDescription="0"/>
<vocation id="11" showInDescription="0"/>
</distance>
<!-- Ammunition -->
<distance id="2545" swing="true" event="script" value="poison_arrow.lua"/>
<distance id="2546" swing="true" event="script" value="burst_arrow.lua"/>
<distance id="7366" swing="true" event="script" value="viper_star.lua"/>
<distance id="7838" swing="true" type="energy" event="script" value="distance_damage.lua"/>
<distance id="7839" swing="true" type="ice" event="script" value="distance_damage.lua"/>
<distance id="7840" swing="true" type="fire" event="script" value="distance_damage.lua"/>
<distance id="7850" swing="true" type="earth" event="script" value="distance_damage.lua"/>
<distance id="3965" swing="true" event="script" value="distance_damage.lua"/> <!-- Hunting Spear -->
<distance id="7378" swing="true" event="script" value="distance_damage.lua"/> <!-- Royal Spear -->
<distance id="7367" swing="true" event="script" value="distance_damage.lua"/> <!-- Enchanted Spear -->
<distance id="7368" swing="true" event="script" value="distance_damage.lua"/> <!-- Assassin Star -->
<distance id="7364" swing="true" event="script" value="distance_damage.lua"/> <!-- Sniper Arrow -->
<distance id="7365" swing="true" event="script" value="distance_damage.lua"/> <!-- Onyx Arrow -->
<distance id="7363" swing="true" event="script" value="distance_damage.lua"/> <!-- Piercing Bolt -->
<distance id="2547" swing="true" event="script" value="distance_damage.lua"/> <!-- Power Bolt -->
<distance id="6529" swing="false" event="script" value="distance_damage.lua"/> <!-- Infernal Bolt -->
<distance id="2544" swing="true" event="script" value="distance_damage.lua"/> <!-- Arrow -->
<distance id="2543" swing="true" event="script" value="distance_damage.lua"/> <!-- Bolt -->