mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[11644] Sets rage to zero and energie to 100% when entering battleground and arena
Move related code to Aura::HandleArenaPreparation (un-)apply code. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
9300842b04
commit
92e0b5941f
3 changed files with 18 additions and 10 deletions
|
|
@ -1220,13 +1220,8 @@ void BattleGround::AddPlayer(Player *plr)
|
||||||
plr->UnsummonPetTemporaryIfAny();
|
plr->UnsummonPetTemporaryIfAny();
|
||||||
|
|
||||||
if(GetStatus() == STATUS_WAIT_JOIN) // not started yet
|
if(GetStatus() == STATUS_WAIT_JOIN) // not started yet
|
||||||
{
|
|
||||||
plr->CastSpell(plr, SPELL_ARENA_PREPARATION, true);
|
plr->CastSpell(plr, SPELL_ARENA_PREPARATION, true);
|
||||||
|
|
||||||
plr->SetHealth(plr->GetMaxHealth());
|
|
||||||
plr->SetPower(POWER_MANA, plr->GetMaxPower(POWER_MANA));
|
|
||||||
}
|
|
||||||
|
|
||||||
plr->CastSpell(plr, SPELL_ARENA_DAMPENING, true);
|
plr->CastSpell(plr, SPELL_ARENA_DAMPENING, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -8041,13 +8041,26 @@ void Aura::HandleManaShield(bool apply, bool Real)
|
||||||
|
|
||||||
void Aura::HandleArenaPreparation(bool apply, bool Real)
|
void Aura::HandleArenaPreparation(bool apply, bool Real)
|
||||||
{
|
{
|
||||||
if(!Real)
|
if (!Real)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(apply)
|
Unit* target = GetTarget();
|
||||||
GetTarget()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREPARATION);
|
|
||||||
|
target->ApplyModFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREPARATION, apply);
|
||||||
|
|
||||||
|
if (apply)
|
||||||
|
{
|
||||||
|
// max regen powers at start preparation
|
||||||
|
target->SetHealth(target->GetMaxHealth());
|
||||||
|
target->SetPower(POWER_MANA, target->GetMaxPower(POWER_MANA));
|
||||||
|
target->SetPower(POWER_ENERGY, target->GetMaxPower(POWER_ENERGY));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
GetTarget()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREPARATION);
|
{
|
||||||
|
// reset originally 0 powers at start/leave
|
||||||
|
target->SetPower(POWER_RAGE, 0);
|
||||||
|
target->SetPower(POWER_RUNIC_POWER, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11643"
|
#define REVISION_NR "11644"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue