[8610] castchecks for recall spell for the av-trinket

this spell should be cast only in battlegrounds
and only after battleground started
This commit is contained in:
balrok 2009-09-17 00:09:40 +02:00
parent bb10fada9a
commit 4dc1df7d54
2 changed files with 16 additions and 1 deletions

View file

@ -2819,6 +2819,21 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
switch(spellInfo->Id)
{
// a trinket in alterac valley allows to teleport to the boss
case 22564: // recall
case 22563: // recall
{
if (!player)
return SPELL_FAILED_REQUIRES_AREA;
MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
if (!mapEntry)
return SPELL_FAILED_REQUIRES_AREA;
if (!mapEntry->IsBattleGround())
return SPELL_FAILED_REQUIRES_AREA;
BattleGround* bg = player->GetBattleGround();
return map_id == 30 && bg && bg->GetStatus()!=STATUS_WAIT_JOIN ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
break;
}
case 23333: // Warsong Flag
case 23335: // Silverwing Flag
return map_id == 489 && player && player->InBattleGround() ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8609"
#define REVISION_NR "8610"
#endif // __REVISION_NR_H__