aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2018-03-07 03:32:32 -0300
committerariel- <ariel-@users.noreply.github.com>2018-03-07 03:34:45 -0300
commit6e0b9a7916d158981cebe6107710141458d656cc (patch)
tree2a44ad4e6049a7ed60b04ffbb8dd7f86d30d44a3 /src/server/scripts/Spells
parent68dde9f8c5467c5983078b190e58105f99dad75c (diff)
Core/Creatures: port power type updates from master branch
Core/Misc: Added helper function Unit::SetFullPower Cherry-picked from 8199eef81cad464bb43f3613ed884a2c8fc3973d Core/Creatures: Updated power type handling (#20981) Cherry-picked from 16a7a414abcc93c4514905b871f53c1049261c12
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp6
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp6
-rw-r--r--src/server/scripts/Spells/spell_item.cpp6
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp4
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp2
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp4
6 files changed, 14 insertions, 14 deletions
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 526157708ad..9f8775e9bb9 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -496,7 +496,7 @@ class spell_dru_frenzied_regeneration : public AuraScript
void PeriodicTick(AuraEffect const* aurEff)
{
// Converts up to 10 rage per second into health for $d. Each point of rage is converted into ${$m2/10}.1% of max health.
- if (GetTarget()->getPowerType() != POWER_RAGE)
+ if (GetTarget()->GetPowerType() != POWER_RAGE)
return;
uint32 rage = GetTarget()->GetPower(POWER_RAGE);
@@ -1357,7 +1357,7 @@ class spell_dru_revitalize : public SpellScriptLoader
Unit* target = eventInfo.GetProcTarget();
uint32 spellId;
- switch (target->getPowerType())
+ switch (target->GetPowerType())
{
case POWER_MANA:
spellId = SPELL_DRUID_REVITALIZE_ENERGIZE_MANA;
@@ -1803,7 +1803,7 @@ class spell_dru_t3_2p_bonus : public SpellScriptLoader
Unit* target = eventInfo.GetProcTarget();
uint32 spellId;
- switch (target->getPowerType())
+ switch (target->GetPowerType())
{
case POWER_MANA:
spellId = SPELL_DRUID_T3_PROC_ENERGIZE_MANA;
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 943642b7d85..dbf7d7da256 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -2627,7 +2627,7 @@ class spell_gen_pet_summoned : public SpellScript
newPet->setDeathState(ALIVE);
newPet->SetFullHealth();
- newPet->SetPower(newPet->getPowerType(), newPet->GetMaxPower(newPet->getPowerType()));
+ newPet->SetPower(newPet->GetPowerType(), newPet->GetMaxPower(newPet->GetPowerType()));
switch (newPet->GetEntry())
{
@@ -2830,7 +2830,7 @@ public:
bool operator()(WorldObject* obj) const
{
if (Unit* target = obj->ToUnit())
- return target->getPowerType() != POWER_MANA;
+ return target->GetPowerType() != POWER_MANA;
return true;
}
@@ -2876,7 +2876,7 @@ class spell_gen_replenishment_aura : public AuraScript
bool Load() override
{
- return GetUnitOwner()->getPowerType() == POWER_MANA;
+ return GetUnitOwner()->GetPowerType() == POWER_MANA;
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index b47ad57c781..490f31b55b8 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -1101,7 +1101,7 @@ class spell_item_heartpierce : public SpellScriptLoader
Unit* caster = eventInfo.GetActor();
uint32 spellId;
- switch (caster->getPowerType())
+ switch (caster->GetPowerType())
{
case POWER_MANA:
spellId = Mana;
@@ -3851,7 +3851,7 @@ class spell_item_mad_alchemists_potion : public SpellScript
Unit* target = GetCaster();
- if (target->getPowerType() == POWER_MANA)
+ if (target->GetPowerType() == POWER_MANA)
availableElixirs.push_back(28509); // Elixir of Major Mageblood (22840)
uint32 chosenElixir = Trinity::Containers::SelectRandomContainerElement(availableElixirs);
@@ -3914,7 +3914,7 @@ class spell_item_crazy_alchemists_potion : public SpellScript
if (!target->IsInCombat())
availableElixirs.push_back(53753); // Potion of Nightmares (40081)
- if (target->getPowerType() == POWER_MANA)
+ if (target->GetPowerType() == POWER_MANA)
availableElixirs.push_back(43186); // Runic Mana Potion(33448)
uint32 chosenElixir = Trinity::Containers::SelectRandomContainerElement(availableElixirs);
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 4386390d49f..928be5a79a6 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -454,7 +454,7 @@ class spell_pal_blessing_of_sanctuary : public SpellScriptLoader
bool CheckProc(ProcEventInfo& /*eventInfo*/)
{
- return GetTarget()->getPowerType() == POWER_MANA;
+ return GetTarget()->GetPowerType() == POWER_MANA;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
@@ -1518,7 +1518,7 @@ class spell_pal_judgement_of_wisdom_mana : public SpellScriptLoader
bool CheckProc(ProcEventInfo& eventInfo)
{
- return eventInfo.GetProcTarget()->getPowerType() == POWER_MANA;
+ return eventInfo.GetProcTarget()->GetPowerType() == POWER_MANA;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index 336b2d54be6..aa8b5a5f91d 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -78,7 +78,7 @@ class PowerCheck
bool operator()(WorldObject* obj) const
{
if (Unit* target = obj->ToUnit())
- return target->getPowerType() != _power;
+ return target->GetPowerType() != _power;
return true;
}
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index 091e06e82fb..a01be4e24f6 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -1541,7 +1541,7 @@ class spell_sha_mana_spring_totem : public SpellScriptLoader
{
if (Unit* target = GetHitUnit())
if (Unit* caster = GetCaster())
- if (target->getPowerType() == POWER_MANA)
+ if (target->GetPowerType() == POWER_MANA)
{
CastSpellExtraArgs args(GetOriginalCaster()->GetGUID());
args.AddSpellBP0(GetEffectValue());
@@ -1608,7 +1608,7 @@ class spell_sha_mana_tide_totem : public SpellScriptLoader
{
if (Unit* unitTarget = GetHitUnit())
{
- if (unitTarget->getPowerType() == POWER_MANA)
+ if (unitTarget->GetPowerType() == POWER_MANA)
{
int32 effValue = GetEffectValue();
// Glyph of Mana Tide