mirror of
https://github.com/mangosfour/server.git
synced 2025-12-26 16:37:06 +00:00
[9892] Cleanups for BattleGroundEY code
Signed-off-by: VladimirMangos <vladimir@getmangos.com> Also prevent send uninitilized mark data in case BATTLEGROUND_EY end. Simplify related code.
This commit is contained in:
parent
312a076491
commit
19b5d777cd
4 changed files with 75 additions and 94 deletions
|
|
@ -855,42 +855,30 @@ uint32 BattleGround::GetBattlemasterEntry() const
|
|||
|
||||
void BattleGround::RewardMark(Player *plr,uint32 count)
|
||||
{
|
||||
BattleGroundMarks mark;
|
||||
bool IsSpell;
|
||||
switch(GetTypeID())
|
||||
{
|
||||
case BATTLEGROUND_AV:
|
||||
IsSpell = true;
|
||||
if (count == ITEM_WINNER_COUNT)
|
||||
mark = SPELL_AV_MARK_WINNER;
|
||||
RewardSpellCast(plr,SPELL_AV_MARK_WINNER);
|
||||
else
|
||||
mark = SPELL_AV_MARK_LOSER;
|
||||
RewardSpellCast(plr,SPELL_AV_MARK_LOSER);
|
||||
break;
|
||||
case BATTLEGROUND_WS:
|
||||
IsSpell = true;
|
||||
if (count == ITEM_WINNER_COUNT)
|
||||
mark = SPELL_WS_MARK_WINNER;
|
||||
RewardSpellCast(plr,SPELL_WS_MARK_WINNER);
|
||||
else
|
||||
mark = SPELL_WS_MARK_LOSER;
|
||||
RewardSpellCast(plr,SPELL_WS_MARK_LOSER);
|
||||
break;
|
||||
case BATTLEGROUND_AB:
|
||||
IsSpell = true;
|
||||
if (count == ITEM_WINNER_COUNT)
|
||||
mark = SPELL_AB_MARK_WINNER;
|
||||
RewardSpellCast(plr,SPELL_AB_MARK_WINNER);
|
||||
else
|
||||
mark = SPELL_AB_MARK_LOSER;
|
||||
break;
|
||||
case BATTLEGROUND_EY:
|
||||
IsSpell = false;
|
||||
RewardSpellCast(plr,SPELL_AB_MARK_LOSER);
|
||||
break;
|
||||
case BATTLEGROUND_EY: // no rewards
|
||||
default:
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
if (IsSpell)
|
||||
RewardSpellCast(plr,mark);
|
||||
else
|
||||
RewardItem(plr,mark,count);
|
||||
}
|
||||
|
||||
void BattleGround::RewardSpellCast(Player *plr, uint32 spell_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue