Skip to content
Permalink
Browse files

Server/Spells: Implement SPELL_EFFECT_DODGE.

Signed-off-by: AriDEV <aridev666@gmail.com>
  • Loading branch information...
AriDEV committed Nov 4, 2019
1 parent 3bdcec2 commit b40e14d6737835572e9c4c510ca9731257f02795
@@ -25735,6 +25735,15 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z)
}
}

void Player::SetCanDodge(bool value)
{
if (m_canDodge == value)
return;

m_canDodge = value;
UpdateDodgePercentage();
}

void Player::SetCanParry(bool value)
{
if (m_canParry == value)
@@ -2662,16 +2662,13 @@ class Player : public Unit, public GridObject<Player>
void SendCorpseReclaimDelay(bool load = false);

uint32 GetBlockPercent() const override { return GetUInt32Value(PLAYER_FIELD_SHIELD_BLOCK); }
bool CanParry() const
{
return m_canParry;
}
bool CanDodge() const { return m_canDodge; }
void SetCanDodge(bool value);
bool CanParry() const { return m_canParry; }
void SetCanParry(bool value);
bool CanBlock() const
{
return m_canBlock;
}
bool CanBlock() const { return m_canBlock; }
void SetCanBlock(bool value);

bool CanTitanGrip() const
{
return m_canTitanGrip;
@@ -3504,6 +3501,7 @@ class Player : public Unit, public GridObject<Player>

uint32 m_WeaponProficiency;
uint32 m_ArmorProficiency;
bool m_canDodge;
bool m_canParry;
bool m_canBlock;
bool m_canTitanGrip;
@@ -291,6 +291,7 @@ class Spell
void EffectEnchantHeldItem(SpellEffIndex effIndex);
void EffectSummonObject(SpellEffIndex effIndex);
void EffectResurrect(SpellEffIndex effIndex);
void EffectDodge(SpellEffIndex effIndex);
void EffectParry(SpellEffIndex effIndex);
void EffectBlock(SpellEffIndex effIndex);
void EffectLeap(SpellEffIndex effIndex);
@@ -91,7 +91,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectWeaponDmg, // 17 SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL
&Spell::EffectResurrect, // 18 SPELL_EFFECT_RESURRECT
&Spell::EffectAddExtraAttacks, // 19 SPELL_EFFECT_ADD_EXTRA_ATTACKS
&Spell::EffectUnused, // 20 SPELL_EFFECT_DODGE one spell: Dodge
&Spell::EffectDodge, // 20 SPELL_EFFECT_DODGE
&Spell::EffectUnused, // 21 SPELL_EFFECT_EVADE one spell: Evade (DND)
&Spell::EffectParry, // 22 SPELL_EFFECT_PARRY
&Spell::EffectBlock, // 23 SPELL_EFFECT_BLOCK one spell: Block
@@ -4589,6 +4589,14 @@ void Spell::EffectAddExtraAttacks(SpellEffIndex effIndex)

ExecuteLogEffectExtraAttacks(effIndex, unitTarget->GetVictim(), damage);
}
void Spell::EffectDodge(SpellEffIndex /*effIndex*/)
{
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
return;

if (m_caster->GetTypeId() == TYPEID_PLAYER)
m_caster->ToPlayer()->SetCanDodge(true);
}

void Spell::EffectParry(SpellEffIndex /*effIndex*/)
{

0 comments on commit b40e14d

Please sign in to comment.
You can’t perform that action at this time.