Togu
Advanced OT User
How am I suppose to do that?
I was looking on movements folder, I couldn't understand how it works.
I don't know if I should do that in C++, in Lua or in both.
Is there some way of adding bleeding condition in C++ (I just found it in the lua file for the bleeding spell)? Cause I know I can create an "invisible" special random skill called Bleeding Hit Chance and then use it in the same way Critical Hit Chance is used.
SOLVED: Working two-handed melee weapon giving bonus bleeding damage:
After player hits another creature wielding a two-handed melee weapon. He has 50% of chance of giving extras bleeding hit based on his skill.
data/weapons/weapons.xml:
data/weapons/scripts/two_handed_melee.lua:
I was looking on movements folder, I couldn't understand how it works.
I don't know if I should do that in C++, in Lua or in both.
Is there some way of adding bleeding condition in C++ (I just found it in the lua file for the bleeding spell)? Cause I know I can create an "invisible" special random skill called Bleeding Hit Chance and then use it in the same way Critical Hit Chance is used.
SOLVED: Working two-handed melee weapon giving bonus bleeding damage:
After player hits another creature wielding a two-handed melee weapon. He has 50% of chance of giving extras bleeding hit based on his skill.
data/weapons/weapons.xml:
XML:
<melee id="2413" script="two_handed_melee.lua" />
data/weapons/scripts/two_handed_melee.lua:
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_BLOCKSHIELD, true)
combat:setFormula(COMBAT_FORMULA_SKILL, 0, 0, 1, 0)
function onUseWeapon(player, variant)
if not combat:execute(player, variant) then
return false
end
if math.random(1, 100) <= 50 then
return false
end
local damage = math.floor((player:getEffectiveSkillLevel(SKILL_STRENGHT) * 0.02) + 1)
player:addDamageCondition(Creature(variant:getNumber()), CONDITION_BLEEDING, DAMAGELIST_CONSTANT_PERIOD, damage, 1, 4)
return true
end
Last edited: