Core/Units: ported power type updates from master branch
This commit is contained in:
1 parent
e67167e8cf
commit
b653f2f819
40 files changed
+259
-278
No files matched your search
+1
-1
@@ -32,6 +32,7 @@
|
||||
enum Spells
|
||||
{
|
||||
// Omnotron
|
||||
SPELL_COUNCIL_ENERGY_DRAIN = 78725,
|
||||
SPELL_CONTROLLER_RECHARGE = 78696,
|
||||
SPELL_RECHARGING_ELECTRON = 78697,
|
||||
SPELL_RECHARGING_MAGMATRON = 78698,
|
||||
@@ -217,7 +218,6 @@ enum FailedAchievementCriteriaMask
|
||||
FAILED_CRITERIA_FLAMETHROWER = 0x8
|
||||
};
|
||||
|
||||
|
||||
struct GolemInfo
|
||||
{
|
||||
uint8 ActivateTextId;
|
||||
|
||||
+1
-1
@@ -193,7 +193,7 @@ public:
|
||||
{
|
||||
//selects a random target that isn't the current victim and is a mana user (selects mana users) but not pets
|
||||
//it also ignores targets who have the aura. We don't want to place the debuff on the same target twice.
|
||||
if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 1, [&](Unit* u) { return u && !u->IsPet() && u->getPowerType() == POWER_MANA && !u->HasAura(SPELL_BURNINGADRENALINE); }))
|
||||
if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 1, [&](Unit* u) { return u && !u->IsPet() && u->GetPowerType() == POWER_MANA && !u->HasAura(SPELL_BURNINGADRENALINE); }))
|
||||
{
|
||||
me->CastSpell(target, SPELL_BURNINGADRENALINE, true);
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ class boss_foe_reaper_5000 : public CreatureScript
|
||||
{
|
||||
boss_foe_reaper_5000AI(Creature* creature) : BossAI(creature, DATA_FOE_REAPER_5000)
|
||||
{
|
||||
me->setPowerType(POWER_ENERGY);
|
||||
me->SetPowerType(POWER_ENERGY);
|
||||
me->SetMaxPower(POWER_ENERGY, 100);
|
||||
Initialize();
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ class instance_deadmines : public InstanceMapScript
|
||||
_ripsnarlNightareGuidSet.insert(creature->GetGUID());
|
||||
break;
|
||||
case NPC_DEFIAS_SHADOWGUARD:
|
||||
creature->setPowerType(POWER_ENERGY);
|
||||
creature->SetPowerType(POWER_ENERGY);
|
||||
creature->SetMaxPower(POWER_ENERGY, 100);
|
||||
creature->SetPower(POWER_ENERGY, 100);
|
||||
break;
|
||||
|
||||
@@ -422,7 +422,7 @@ public:
|
||||
if (ManaBurn_Timer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
if (target->getPowerType() == POWER_MANA)
|
||||
if (target->GetPowerType() == POWER_MANA)
|
||||
DoCast(target, SPELL_MANABURN);
|
||||
ManaBurn_Timer = 5000; // 3 sec cast
|
||||
} else ManaBurn_Timer -= diff;
|
||||
|
||||
@@ -175,7 +175,7 @@ class MarkTargetFilter
|
||||
bool operator()(WorldObject* target) const
|
||||
{
|
||||
if (Unit* unit = target->ToUnit())
|
||||
return unit->getPowerType() != POWER_MANA;
|
||||
return unit->GetPowerType() != POWER_MANA;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -150,7 +150,7 @@ class boss_moam : public CreatureScript
|
||||
{
|
||||
const std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
if ((*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER && (*itr)->getTarget()->getPowerType() == POWER_MANA)
|
||||
if ((*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER && (*itr)->getTarget()->GetPowerType() == POWER_MANA)
|
||||
targetList.push_back((*itr)->getTarget());
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -628,7 +628,7 @@ struct boss_faction_championsAI : public BossAI
|
||||
|
||||
void UpdatePower()
|
||||
{
|
||||
if (me->getPowerType() == POWER_MANA)
|
||||
if (me->GetPowerType() == POWER_MANA)
|
||||
me->ModifyPower(POWER_MANA, me->GetMaxPower(POWER_MANA) / 3);
|
||||
}
|
||||
|
||||
@@ -697,7 +697,7 @@ struct boss_faction_championsAI : public BossAI
|
||||
for (iter = tList.begin(); iter!=tList.end(); ++iter)
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, (*iter)->getUnitGuid());
|
||||
if (target && target->getPowerType() == POWER_MANA)
|
||||
if (target && target->GetPowerType() == POWER_MANA)
|
||||
return target;
|
||||
}
|
||||
return nullptr;
|
||||
@@ -1849,7 +1849,7 @@ class npc_toc_rogue : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_EVISCERATE, urand(20*IN_MILLISECONDS, 40*IN_MILLISECONDS));
|
||||
events.ScheduleEvent(EVENT_WOUND_POISON, urand(5*IN_MILLISECONDS, 10*IN_MILLISECONDS));
|
||||
SetEquipmentSlots(false, 47422, 49982, EQUIP_NO_CHANGE);
|
||||
me->setPowerType(POWER_ENERGY);
|
||||
me->SetPowerType(POWER_ENERGY);
|
||||
me->SetMaxPower(POWER_ENERGY, 100);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -536,7 +536,7 @@ class MistressKissTargetSelector
|
||||
bool operator()(WorldObject* unit) const
|
||||
{
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
if (unit->ToPlayer()->getPowerType() == POWER_MANA)
|
||||
if (unit->ToPlayer()->GetPowerType() == POWER_MANA)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -271,7 +271,7 @@ class spell_bronjahm_magic_bane : public SpellScriptLoader
|
||||
|
||||
void RecalculateDamage()
|
||||
{
|
||||
if (GetHitUnit()->getPowerType() != POWER_MANA)
|
||||
if (GetHitUnit()->GetPowerType() != POWER_MANA)
|
||||
return;
|
||||
|
||||
int32 const maxDamage = GetCaster()->GetMap()->IsHeroic() ? 15000 : 10000;
|
||||
|
||||
@@ -1078,7 +1078,7 @@ class spell_deathbringer_blood_link_aura : public SpellScriptLoader
|
||||
void HandlePeriodicTick(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (GetUnitOwner()->getPowerType() == POWER_ENERGY && GetUnitOwner()->GetPower(POWER_ENERGY) == GetUnitOwner()->GetMaxPower(POWER_ENERGY))
|
||||
if (GetUnitOwner()->GetPowerType() == POWER_ENERGY && GetUnitOwner()->GetPower(POWER_ENERGY) == GetUnitOwner()->GetMaxPower(POWER_ENERGY))
|
||||
if (Creature* saurfang = GetUnitOwner()->ToCreature())
|
||||
saurfang->AI()->DoAction(ACTION_MARK_OF_THE_FALLEN_CHAMPION);
|
||||
}
|
||||
|
||||
@@ -1152,7 +1152,7 @@ class UnchainedMagicTargetSelector
|
||||
bool operator()(WorldObject* object) const
|
||||
{
|
||||
if (Unit* unit = object->ToUnit())
|
||||
return unit->getPowerType() != POWER_MANA;
|
||||
return unit->GetPowerType() != POWER_MANA;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -168,7 +168,7 @@ struct ManaVoidSelector
|
||||
|
||||
bool operator()(Unit* unit) const
|
||||
{
|
||||
return unit->getPowerType() == POWER_MANA && _source->GetDistance(unit) > 15.0f;
|
||||
return unit->GetPowerType() == POWER_MANA && _source->GetDistance(unit) > 15.0f;
|
||||
}
|
||||
|
||||
WorldObject const* _source;
|
||||
|
||||
@@ -200,7 +200,7 @@ struct ManaUserTargetSelector
|
||||
{
|
||||
bool operator()(Unit const* target) const
|
||||
{
|
||||
return target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() == POWER_MANA;
|
||||
return target->GetTypeId() == TYPEID_PLAYER && target->GetPowerType() == POWER_MANA;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ class boss_anzu : public CreatureScript
|
||||
case EVENT_SPELL_BOMB:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
if (target->getPowerType() == POWER_MANA)
|
||||
if (target->GetPowerType() == POWER_MANA)
|
||||
{
|
||||
DoCast(target, SPELL_SPELL_BOMB);
|
||||
Talk(SAY_SPELL_BOMB, target);
|
||||
|
||||
@@ -209,7 +209,7 @@ public:
|
||||
if (ManaBurn_Timer <= diff)
|
||||
{
|
||||
Unit* target = me->GetVictim();
|
||||
if (target && target->getPowerType() == POWER_MANA)
|
||||
if (target && target->GetPowerType() == POWER_MANA)
|
||||
DoCast(target, SPELL_MANA_BURN);
|
||||
ManaBurn_Timer = 8000 + rand32() % 8000;
|
||||
} else ManaBurn_Timer -= diff;
|
||||
|
||||
@@ -87,7 +87,7 @@ class npcs_ashyen_and_keleth : public CreatureScript
|
||||
ClearGossipMenuFor(player);
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
me->setPowerType(POWER_MANA);
|
||||
me->SetPowerType(POWER_MANA);
|
||||
me->SetMaxPower(POWER_MANA, 200); //set a "fake" mana value, we can't depend on database doing it in this case
|
||||
me->SetPower(POWER_MANA, 200);
|
||||
|
||||
|
||||
@@ -2783,7 +2783,7 @@ class spell_gen_pet_summoned : public SpellScriptLoader
|
||||
newPet->setDeathState(ALIVE);
|
||||
|
||||
newPet->SetFullHealth();
|
||||
newPet->SetPower(newPet->getPowerType(), newPet->GetMaxPower(newPet->getPowerType()));
|
||||
newPet->SetPower(newPet->GetPowerType(), newPet->GetMaxPower(newPet->GetPowerType()));
|
||||
|
||||
switch (newPet->GetEntry())
|
||||
{
|
||||
@@ -2904,7 +2904,7 @@ public:
|
||||
bool operator()(WorldObject* obj) const
|
||||
{
|
||||
if (Unit* target = obj->ToUnit())
|
||||
return target->getPowerType() != POWER_MANA;
|
||||
return target->GetPowerType() != POWER_MANA;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2960,7 +2960,7 @@ class spell_gen_replenishment : public SpellScriptLoader
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetUnitOwner()->getPowerType() == POWER_MANA;
|
||||
return GetUnitOwner()->GetPowerType() == POWER_MANA;
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
|
||||
@@ -1203,7 +1203,7 @@ class spell_item_heartpierce : public SpellScriptLoader
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
|
||||
uint32 spellId;
|
||||
switch (caster->getPowerType())
|
||||
switch (caster->GetPowerType())
|
||||
{
|
||||
case POWER_MANA:
|
||||
spellId = Mana;
|
||||
@@ -4253,7 +4253,7 @@ public:
|
||||
|
||||
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);
|
||||
@@ -4328,7 +4328,7 @@ public:
|
||||
|
||||
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);
|
||||
|
||||
@@ -128,7 +128,7 @@ class PowerCheck
|
||||
bool operator()(WorldObject* obj) const
|
||||
{
|
||||
if (Unit* target = obj->ToUnit())
|
||||
return target->getPowerType() != _power;
|
||||
return target->GetPowerType() != _power;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -46,24 +46,12 @@ class DuelResetScript : public PlayerScript
|
||||
if (sWorld->getBoolConfig(CONFIG_RESET_DUEL_HEALTH_MANA))
|
||||
{
|
||||
player1->SaveHealthBeforeDuel();
|
||||
player1->SetHealth(player1->GetMaxHealth());
|
||||
player1->SaveManaBeforeDuel();
|
||||
player1->ResetAllPowers();
|
||||
|
||||
player2->SaveHealthBeforeDuel();
|
||||
player2->SetHealth(player2->GetMaxHealth());
|
||||
|
||||
// check if player1 class uses mana
|
||||
if (player1->getPowerType() == POWER_MANA || player1->getClass() == CLASS_DRUID)
|
||||
{
|
||||
player1->SaveManaBeforeDuel();
|
||||
player1->SetPower(POWER_MANA, player1->GetMaxPower(POWER_MANA));
|
||||
}
|
||||
|
||||
// check if player2 class uses mana
|
||||
if (player2->getPowerType() == POWER_MANA || player2->getClass() == CLASS_DRUID)
|
||||
{
|
||||
player2->SaveManaBeforeDuel();
|
||||
player2->SetPower(POWER_MANA, player2->GetMaxPower(POWER_MANA));
|
||||
}
|
||||
player2->SaveManaBeforeDuel();
|
||||
player2->ResetAllPowers();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,11 +78,11 @@ class DuelResetScript : public PlayerScript
|
||||
loser->RestoreHealthAfterDuel();
|
||||
|
||||
// check if player1 class uses mana
|
||||
if (winner->getPowerType() == POWER_MANA || winner->getClass() == CLASS_DRUID)
|
||||
if (winner->GetPowerType() == POWER_MANA || winner->getClass() == CLASS_DRUID)
|
||||
winner->RestoreManaAfterDuel();
|
||||
|
||||
// check if player2 class uses mana
|
||||
if (loser->getPowerType() == POWER_MANA || loser->getClass() == CLASS_DRUID)
|
||||
if (loser->GetPowerType() == POWER_MANA || loser->getClass() == CLASS_DRUID)
|
||||
loser->RestoreManaAfterDuel();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user