mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-04-30 09:39:20 +02:00
Revert "fix poison condition to be applied from poison monsters only when you can't block it porperly"
This reverts commit dca9e61345cc16b7d31117da0049ad8ea7e92ac9.
This commit is contained in:
parent
5a007594d5
commit
fa636a5f99
@ -886,7 +886,26 @@ bool Combat::closeAttack(Creature* attacker, Creature* target, fightMode_t fight
|
|||||||
combatDamage.value = totalDamage;
|
combatDamage.value = totalDamage;
|
||||||
combatDamage.origin = ORIGIN_MELEE;
|
combatDamage.origin = ORIGIN_MELEE;
|
||||||
|
|
||||||
Combat::doCombatHealth(attacker, target, combatDamage, combatParams);
|
bool hit = Combat::doCombatHealth(attacker, target, combatDamage, combatParams);
|
||||||
|
|
||||||
|
if (Monster* monster = attacker->getMonster()) {
|
||||||
|
int32_t poison = monster->mType->info.poison;
|
||||||
|
if (poison) {
|
||||||
|
int32_t randTest = rand();
|
||||||
|
|
||||||
|
if (hit || ((-totalDamage > defense) && (randTest == 5 * (randTest / 5)))) {
|
||||||
|
poison = normal_random(poison / 2, poison);
|
||||||
|
if (poison) {
|
||||||
|
ConditionDamage* condition = static_cast<ConditionDamage*>(Condition::createCondition(CONDITIONID_COMBAT, CONDITION_POISON, 0, 0));
|
||||||
|
condition->setParam(CONDITION_PARAM_OWNER, attacker->getID());
|
||||||
|
condition->setParam(CONDITION_PARAM_CYCLE, poison);
|
||||||
|
condition->setParam(CONDITION_PARAM_COUNT, 3);
|
||||||
|
condition->setParam(CONDITION_PARAM_MAX_COUNT, 3);
|
||||||
|
target->addCombatCondition(condition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Player* player = attacker->getPlayer()) {
|
if (Player* player = attacker->getPlayer()) {
|
||||||
// skills advancing
|
// skills advancing
|
||||||
@ -1264,7 +1283,7 @@ void Combat::postWeaponEffects(Player* player, Item* weapon)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Combat::doCombatHealth(Creature* caster, Creature* target, CombatDamage& damage, const CombatParams& params)
|
bool Combat::doCombatHealth(Creature* caster, Creature* target, CombatDamage& damage, const CombatParams& params)
|
||||||
{
|
{
|
||||||
bool canCombat = !params.aggressive || (caster != target && Combat::canDoCombat(caster, target) == RETURNVALUE_NOERROR);
|
bool canCombat = !params.aggressive || (caster != target && Combat::canDoCombat(caster, target) == RETURNVALUE_NOERROR);
|
||||||
if ((caster == target || canCombat) && params.impactEffect != CONST_ME_NONE) {
|
if ((caster == target || canCombat) && params.impactEffect != CONST_ME_NONE) {
|
||||||
@ -1281,6 +1300,8 @@ void Combat::doCombatHealth(Creature* caster, Creature* target, CombatDamage& da
|
|||||||
params.targetCallback->onTargetCombat(caster, target);
|
params.targetCallback->onTargetCombat(caster, target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return canCombat;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Combat::doCombatHealth(Creature* caster, const Position& position, const AreaCombat* area, CombatDamage& damage, const CombatParams& params)
|
void Combat::doCombatHealth(Creature* caster, const Position& position, const AreaCombat* area, CombatDamage& damage, const CombatParams& params)
|
||||||
|
@ -293,7 +293,7 @@ class Combat
|
|||||||
|
|
||||||
static void getAttackValue(Creature* creature, uint32_t& attackValue, uint32_t& skillValue, uint8_t& skill);
|
static void getAttackValue(Creature* creature, uint32_t& attackValue, uint32_t& skillValue, uint8_t& skill);
|
||||||
|
|
||||||
static void doCombatHealth(Creature* caster, Creature* target, CombatDamage& damage, const CombatParams& params);
|
static bool doCombatHealth(Creature* caster, Creature* target, CombatDamage& damage, const CombatParams& params);
|
||||||
static void doCombatHealth(Creature* caster, const Position& position, const AreaCombat* area, CombatDamage& damage, const CombatParams& params);
|
static void doCombatHealth(Creature* caster, const Position& position, const AreaCombat* area, CombatDamage& damage, const CombatParams& params);
|
||||||
|
|
||||||
static void doCombatMana(Creature* caster, Creature* target, CombatDamage& damage, const CombatParams& params);
|
static void doCombatMana(Creature* caster, Creature* target, CombatDamage& damage, const CombatParams& params);
|
||||||
|
@ -825,23 +825,6 @@ BlockType_t Creature::blockHit(Creature* attacker, CombatType_t combatType, int3
|
|||||||
if (attacker) {
|
if (attacker) {
|
||||||
attacker->onAttackedCreature(this);
|
attacker->onAttackedCreature(this);
|
||||||
attacker->onAttackedCreatureBlockHit(blockType);
|
attacker->onAttackedCreatureBlockHit(blockType);
|
||||||
|
|
||||||
if (Monster* monster = attacker->getMonster()) {
|
|
||||||
int32_t poison = monster->mType->info.poison;
|
|
||||||
if (poison) {
|
|
||||||
if (blockType == BLOCK_NONE || blockType == BLOCK_ARMOR) {
|
|
||||||
poison = normal_random(poison / 2, poison);
|
|
||||||
if (poison) {
|
|
||||||
ConditionDamage* condition = static_cast<ConditionDamage*>(Condition::createCondition(CONDITIONID_COMBAT, CONDITION_POISON, 0, 0));
|
|
||||||
condition->setParam(CONDITION_PARAM_OWNER, attacker->getID());
|
|
||||||
condition->setParam(CONDITION_PARAM_CYCLE, poison);
|
|
||||||
condition->setParam(CONDITION_PARAM_COUNT, 3);
|
|
||||||
condition->setParam(CONDITION_PARAM_MAX_COUNT, 3);
|
|
||||||
addCombatCondition(condition);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onAttacked();
|
onAttacked();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user