aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-07-31 11:55:00 +0200
committerShauren <shauren.trinity@gmail.com>2023-07-31 11:55:00 +0200
commit197d4369c894e9b088f862c7189f4fe20b4836ca (patch)
treee09203a72e664327b567bb039e84e9e2ac6f780e /src
parent4c29e456206424052c0e8df4321eae73aec18086 (diff)
Core/Spells: Removed old combo point code leftovers
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp9
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp39
-rw-r--r--src/server/game/Entities/Unit/Unit.h6
-rw-r--r--src/server/game/Spells/Spell.cpp43
-rw-r--r--src/server/game/Spells/Spell.h2
-rw-r--r--src/server/game/Spells/SpellDefines.h2
-rw-r--r--src/server/game/Spells/SpellInfo.cpp9
-rw-r--r--src/server/game/Spells/SpellInfo.h1
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp2
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp2
10 files changed, 10 insertions, 105 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index ef02af2c52e..059b3a88a84 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -1232,8 +1232,7 @@ void Player::setDeathState(DeathState s)
// drunken state is cleared on death
SetDrunkValue(0);
- // lost combo points at any target (targeted combo points clear in Unit::setDeathState)
- ClearComboPoints();
+ SetPower(POWER_COMBO_POINTS, 0);
ClearResurrectRequestData();
@@ -1615,7 +1614,7 @@ void Player::RemoveFromWorld()
StopCastingCharm();
StopCastingBindSight();
UnsummonPetTemporaryIfAny();
- ClearComboPoints();
+ SetPower(POWER_COMBO_POINTS, 0);
m_session->DoLootReleaseAll();
m_lootRolls.clear();
sOutdoorPvPMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId);
@@ -7764,8 +7763,8 @@ void Player::DuelComplete(DuelCompleteType type)
opponent->RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2::DuelEnd);
// cleanup combo points
- ClearComboPoints();
- opponent->ClearComboPoints();
+ SetPower(POWER_COMBO_POINTS, 0);
+ opponent->SetPower(POWER_COMBO_POINTS, 0);
//cleanups
SetDuelArbiter(ObjectGuid::Empty);
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 8f5cb9990fd..0b053207feb 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -10289,45 +10289,6 @@ void Unit::RestoreDisplayId(bool ignorePositiveAurasPreventingMounting /*= false
SetDisplayId(GetNativeDisplayId());
}
-void Unit::AddComboPoints(int8 count, Spell* spell)
-{
- if (!count)
- return;
-
- int8 comboPoints = spell ? spell->m_comboPointGain : GetPower(POWER_COMBO_POINTS);
-
- comboPoints += count;
-
- if (comboPoints > 5)
- comboPoints = 5;
- else if (comboPoints < 0)
- comboPoints = 0;
-
- if (!spell)
- SetPower(POWER_COMBO_POINTS, comboPoints);
- else
- spell->m_comboPointGain = comboPoints;
-}
-
-void Unit::GainSpellComboPoints(int8 count)
-{
- if (!count)
- return;
-
- int8 cp = GetPower(POWER_COMBO_POINTS);
-
- cp += count;
- if (cp > 5) cp = 5;
- else if (cp < 0) cp = 0;
-
- SetPower(POWER_COMBO_POINTS, cp);
-}
-
-void Unit::ClearComboPoints()
-{
- SetPower(POWER_COMBO_POINTS, 0);
-}
-
void Unit::ClearAllReactives()
{
for (uint8 i = 0; i < MAX_REACTIVE; ++i)
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index f9d1153ae58..aa2bfee5b6c 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1784,12 +1784,6 @@ class TC_GAME_API Unit : public WorldObject
void SetControlled(bool apply, UnitState state);
void ApplyControlStatesIfNeeded();
- ///-----------Combo point system-------------------
- uint32 GetComboPoints() const { return uint32(GetPower(POWER_COMBO_POINTS)); }
- void AddComboPoints(int8 count, Spell* spell = nullptr);
- void GainSpellComboPoints(int8 count);
- void ClearComboPoints();
-
///----------Pet responses methods-----------------
void SendPetActionFeedback(PetActionFeedback msg, uint32 spellId);
void SendPetTalk(uint32 pettalk);
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index c4aa677563c..d525cde3a66 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -507,8 +507,6 @@ m_spellValue(new SpellValue(m_spellInfo, caster)), _spellEvent(nullptr)
m_selfContainer = nullptr;
m_referencedFromCurrentSpell = false;
m_executedCurrently = false;
- m_needComboPoints = m_spellInfo->NeedsComboPoints();
- m_comboPointGain = 0;
m_delayStart = 0;
m_delayAtDamageCount = 0;
@@ -2946,10 +2944,6 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
spell->m_hitMask |= hitMask;
spell->m_procSpellType |= procSpellType;
- // Do not take combo points on dodge and miss
- if (MissCondition != SPELL_MISS_NONE && spell->m_needComboPoints && spell->m_targets.GetUnitTargetGUID() == TargetGUID)
- spell->m_needComboPoints = false;
-
// _spellHitTarget can be null if spell is missed in DoSpellHitOnUnit
if (MissCondition != SPELL_MISS_EVADE && _spellHitTarget && !spell->m_caster->IsFriendlyTo(unit) && (!spell->IsPositive() || spell->m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)))
{
@@ -3442,10 +3436,6 @@ SpellCastResult Spell::prepare(SpellCastTargets const& targets, AuraEffect const
if (!m_CastItem)
m_powerCost = m_spellInfo->CalcPowerCost(m_caster, m_spellSchoolMask, this);
- // Set combo point requirement
- if ((_triggeredCastFlags & TRIGGERED_IGNORE_COMBO_POINTS) || m_CastItem)
- m_needComboPoints = false;
-
int32 param1 = 0, param2 = 0;
SpellCastResult result = CheckCast(true, &param1, &param2);
// target is checked in too many locations and with different results to handle each of them
@@ -4132,18 +4122,8 @@ void Spell::_handle_immediate_phase()
void Spell::_handle_finish_phase()
{
if (Unit* unitCaster = m_caster->ToUnit())
- {
- // Take for real after all targets are processed
- if (m_needComboPoints)
- unitCaster->ClearComboPoints();
-
- // Real add combo points from effects
- if (m_comboPointGain)
- unitCaster->AddComboPoints(m_comboPointGain);
-
if (m_spellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS))
unitCaster->SetLastExtraAttackSpell(m_spellInfo->Id);
- }
// Handle procs on finish
if (!m_originalCaster)
@@ -5657,21 +5637,6 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
}
}
- bool reqCombat = true;
- Unit::AuraEffectList const& stateAuras = unitCaster->GetAuraEffectsByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
- for (Unit::AuraEffectList::const_iterator j = stateAuras.begin(); j != stateAuras.end(); ++j)
- {
- if ((*j)->IsAffectingSpell(m_spellInfo))
- {
- m_needComboPoints = false;
- if ((*j)->GetMiscValue() == 1)
- {
- reqCombat = false;
- break;
- }
- }
- }
-
// caster state requirements
// not for triggered spells (needed by execute)
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_CASTER_AURASTATE))
@@ -5692,7 +5657,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
if (m_spellInfo->ExcludeCasterAuraType && unitCaster->HasAuraType(m_spellInfo->ExcludeCasterAuraType))
return SPELL_FAILED_CASTER_AURASTATE;
- if (reqCombat && unitCaster->IsInCombat() && !m_spellInfo->CanBeUsedInCombat(unitCaster))
+ if (unitCaster->IsInCombat() && !m_spellInfo->CanBeUsedInCombat(unitCaster))
return SPELL_FAILED_AFFECTING_COMBAT;
}
@@ -6685,12 +6650,6 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
return SPELL_FAILED_ITEM_ALREADY_ENCHANTED;
}
- // check if caster has at least 1 combo point for spells that require combo points
- if (m_needComboPoints)
- if (Player* plrCaster = m_caster->ToPlayer())
- if (!plrCaster->GetComboPoints())
- return SPELL_FAILED_NO_COMBO_POINTS;
-
// all ok
return SPELL_CAST_OK;
}
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index 7fee514e51c..61c283cb82c 100644
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -588,7 +588,6 @@ class TC_GAME_API Spell
std::any m_customArg;
SpellCastVisual m_SpellVisual;
SpellCastTargets m_targets;
- int8 m_comboPointGain;
SpellCustomErrors m_customError;
UsedSpellMods m_appliedMods;
@@ -705,7 +704,6 @@ class TC_GAME_API Spell
// These vars are used in both delayed spell system and modified immediate spell system
bool m_referencedFromCurrentSpell; // mark as references to prevent deleted and access by dead pointers
bool m_executedCurrently; // mark as executed to prevent deleted and access by dead pointers
- bool m_needComboPoints;
uint32 m_applyMultiplierMask;
float m_damageMultipliers[MAX_SPELL_EFFECTS];
diff --git a/src/server/game/Spells/SpellDefines.h b/src/server/game/Spells/SpellDefines.h
index cd5a9883df4..4cfedbe9de4 100644
--- a/src/server/game/Spells/SpellDefines.h
+++ b/src/server/game/Spells/SpellDefines.h
@@ -245,7 +245,7 @@ enum TriggerCastFlags : uint32
TRIGGERED_IGNORE_CAST_ITEM = 0x00000008, //! Will not take away cast item or update related achievement criteria
TRIGGERED_IGNORE_AURA_SCALING = 0x00000010, //! Will ignore aura scaling
TRIGGERED_IGNORE_CAST_IN_PROGRESS = 0x00000020, //! Will not check if a current cast is in progress
- TRIGGERED_IGNORE_COMBO_POINTS = 0x00000040, //! Will ignore combo point requirement
+ // reuse = 0x00000040,
TRIGGERED_CAST_DIRECTLY = 0x00000080, //! In Spell::prepare, will be cast directly without setting containers for executed spell
TRIGGERED_IGNORE_AURA_INTERRUPT_FLAGS = 0x00000100, //! Will ignore interruptible aura's at cast
TRIGGERED_IGNORE_SET_FACING = 0x00000200, //! Will not adjust facing to target (if any)
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index b0cef2841d6..1c08ed30c7f 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -526,7 +526,7 @@ int32 SpellEffectInfo::CalcValue(WorldObject const* caster /*= nullptr*/, int32
}
else if (GetScalingExpectedStat() == ExpectedStatType::None)
{
- if (casterUnit && basePointsPerLevel != 0.0f)
+ if (casterUnit && basePointsPerLevel != 0.0)
{
int32 level = int32(casterUnit->GetLevel());
if (level > int32(_spellInfo->MaxLevel) && _spellInfo->MaxLevel > 0)
@@ -545,7 +545,7 @@ int32 SpellEffectInfo::CalcValue(WorldObject const* caster /*= nullptr*/, int32
{
// bonus amount from combo points
if (comboDamage)
- if (uint32 comboPoints = casterUnit->GetComboPoints())
+ if (int32 comboPoints = casterUnit->GetPower(POWER_COMBO_POINTS))
value += comboDamage * comboPoints;
}
@@ -1710,11 +1710,6 @@ bool SpellInfo::IsMoveAllowedChannel() const
return IsChanneled() && !ChannelInterruptFlags.HasFlag(SpellAuraInterruptFlags::Moving | SpellAuraInterruptFlags::Turning);
}
-bool SpellInfo::NeedsComboPoints() const
-{
- return HasAttribute(SpellAttr1(SPELL_ATTR1_FINISHING_MOVE_DAMAGE | SPELL_ATTR1_FINISHING_MOVE_DURATION));
-}
-
bool SpellInfo::IsNextMeleeSwingSpell() const
{
return HasAttribute(SpellAttr0(SPELL_ATTR0_ON_NEXT_SWING_NO_DAMAGE | SPELL_ATTR0_ON_NEXT_SWING));
diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
index 9b44dc1d249..506d77d6d65 100644
--- a/src/server/game/Spells/SpellInfo.h
+++ b/src/server/game/Spells/SpellInfo.h
@@ -495,7 +495,6 @@ class TC_GAME_API SpellInfo
bool IsPositiveEffect(uint8 effIndex) const;
bool IsChanneled() const;
bool IsMoveAllowedChannel() const;
- bool NeedsComboPoints() const;
bool IsNextMeleeSwingSpell() const;
bool IsRangedWeaponSpell() const;
bool IsAutoRepeatRangedSpell() const;
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index ca643de8db7..760dbb40c73 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -961,7 +961,7 @@ class spell_dru_rip : public AuraScript
if (Unit* caster = GetCaster())
{
// 0.01 * $AP * cp
- uint32 cp = caster->ToPlayer()->GetComboPoints();
+ int32 cp = caster->GetPower(POWER_COMBO_POINTS);
// Idol of Feral Shadows. Can't be handled as SpellMod due its dependency from CPs
if (AuraEffect const* auraEffIdolOfFeralShadows = caster->GetAuraEffect(SPELL_DRUID_IDOL_OF_FERAL_SHADOWS, EFFECT_0))
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index 808dbc89ab0..dc724340f64 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -596,7 +596,7 @@ class spell_rog_rupture : public AuraScript
0.0375f // 5 points: ${($m1 + $b1*5 + 0.0375 * $AP) * 8} damage over 16 secs
};
- uint32 cp = caster->GetComboPoints();
+ int32 cp = caster->GetPower(POWER_COMBO_POINTS);
if (cp > 5)
cp = 5;