void Combat::doCombat(Creature* caster, const Position& position) const { //area combat callback function if (params.combatType != COMBAT_NONE) { CombatDamage damage = getCombatDamage(caster, nullptr); if (damage.primary.type != COMBAT_MANADRAIN) { doCombatHealth(caster, position, area, damage, params); } else { doCombatMana(caster, position, area, damage, params); } } else { CombatFunc(caster, position, area, params, CombatnullptrFunc, nullptr); } }
void Combat::doCombat(Creature* caster, Creature* target) const { //target combat callback function if (params.combatType != COMBAT_NONE) { CombatDamage damage = getCombatDamage(caster, target); if (damage.primary.type != COMBAT_MANADRAIN) { doCombatHealth(caster, target, damage, params); } else { doCombatMana(caster, target, damage, params); } } else { doCombatDefault(caster, target, params); } }
void Combat::doCombat(const CreatureP& caster, const Position& pos) const { //area combat callback function if(params.combatType != COMBAT_NONE) { int32_t minChange = 0, maxChange = 0; getMinMaxValues(caster, nullptr, minChange, maxChange); if(params.combatType != COMBAT_MANADRAIN) doCombatHealth(caster, pos, area, minChange, maxChange, params); else doCombatMana(caster, pos, area, minChange, maxChange, params); } else CombatFunc(caster, pos, area, params, CombatNullFunc, nullptr); }
void Combat::doCombat(const CreatureP& caster, const CreatureP& target) const { //target combat callback function if(params.combatType != COMBAT_NONE) { int32_t minChange = 0, maxChange = 0; getMinMaxValues(caster, target, minChange, maxChange); if(params.combatType != COMBAT_MANADRAIN) doCombatHealth(caster, target, minChange, maxChange, params); else doCombatMana(caster, target, minChange, maxChange, params); } else doCombatDefault(caster, target, params); }
void Combat::doCombat(Creature* caster, const Position& pos) const { //area combat callback function if(params.combatType != COMBAT_NONE){ int32_t minChange = 0; int32_t maxChange = 0; getMinMaxValues(caster, NULL, minChange, maxChange); if(params.combatType != COMBAT_MANADRAIN){ doCombatHealth(caster, pos, area, minChange, maxChange, params); } else{ doCombatMana(caster, pos, area, minChange, maxChange, params); } } else{ CombatFunc(caster, pos, area, params, CombatNullFunc, NULL); } }
void Combat::doCombat(Creature* caster, Creature* target) const { //target combat callback function if(params.combatType != COMBAT_NONE) { if(params.isAggressive && (caster == target || Combat::canDoCombat(caster, target, true) != RET_NOERROR)) return; int32_t minChange = 0, maxChange = 0; CombatParams _params = params; getMinMaxValues(caster, target, _params, minChange, maxChange); if(params.combatType != COMBAT_MANADRAIN) doCombatHealth(caster, target, minChange, maxChange, _params, false); else doCombatMana(caster, target, minChange, maxChange, _params, false); } else doCombatDefault(caster, target, params); }