Skip to content

Commit

Permalink
Combat and boosts changes (#2497)
Browse files Browse the repository at this point in the history
completely rewritten combat.cpp, instead of bunch of functions, we are now using only two "internal" ones.
one main function doCombat() with target and position parameter, which leads to doTargetCombat() and doAreaCombat()
two new functions for boosts:
Combat::checkCriticalHit() which is used to check if the combat is critical
Combat::checkLeech which is used to check if we can leech combat.
now we do not use doTargetCombatHealth, doTargetCombatMana ... in lua side anymore, only two functions for everything:
doTargetCombat(cid, target, type, min, max, effect)
doAreaCombat(cid, type, pos, area, min, max, effect)
doAreaDispel/doAreaCondition ... were removed, because they are deprecated in my opinion.
some bugs with boosts, ex. criticals weren't calculated properly, when player was in combat with another player, are fixed.
  • Loading branch information
nekiro committed Mar 14, 2020
1 parent 26dba5f commit 831adb2
Show file tree
Hide file tree
Showing 8 changed files with 329 additions and 495 deletions.
5 changes: 5 additions & 0 deletions data/lib/compat/compat.lua
Expand Up @@ -311,6 +311,11 @@ setCombatCondition = function(...)
Combat.addCondition(...)
end

function doTargetCombatHealth(...) return doTargetCombat(...) end
function doAreaCombatHealth(...) return doAreaCombat(...) end
function doTargetCombatMana(cid, target, min, max, effect) return doTargetCombat(cid, target, COMBAT_MANADRAIN, min, max, effect) end
function doAreaCombatMana(cid, pos, area, min, max, effect) return doAreaCombat(cid, COMBAT_MANADRAIN, pos, area, min, max, effect) end

createConditionObject = Condition
setConditionParam = Condition.setParameter
setConditionFormula = Condition.setFormula
Expand Down

0 comments on commit 831adb2

Please sign in to comment.