[REQ] Area entering requirement from a certain spell

Hello friends

How can restrict a area to characters must have a spell for entering.

for example : if Player don’t have {aura number X}(Buff) and try to enter {area 4570} (Circles of Wills) then teleport player to dalaran .

Is this possible ?

Yes, use spell_area + some spell that teleport to dalaran.

Yes, use spell_area + some spell that teleport to dalaran.

Thanks nerv , but I want to check if Player don’t have buff X (aura is not used on player) and entering to Area X , teleport Player to dalaran .

If Player have buff X (aura active on Player) , then nothing do and don’t teleport Player to anywhere and can enter that zone .

How can restrict a area to characters must have a spell for entering.

for example : if Player don’t have {aura number X}(Buff) and try to enter {area 4570} (Circles of Wills) then teleport player to dalaran .

aura_spell

If set, this value (plus or minus aura spell ID from Spell.dbc) imposes additional condition.

The value has the following effect:

< 0 (negative values) If the player has aura -aura_spell then the spell will not be activated.

0 this column is ignored.

0 (positive values) If the player has no aura aura_spell then the spell will not be activated.

E.g. give them some aura that allows them to enter.

[CODE]enum
{
AREA_ID = 0000,
SPELL_ID = 10000
};
// set AreaID SpellID and teleport coords before testing…
class AreaCheck : public PlayerScript
{
public:
AreaCheck() : PlayerScript(“AreaCheck”) {}

void OnUpdateZone(Player* player, uint32 zone, uint32 area)
{
    if(zone == AREA_ID || area == AREA_ID)
    {
        if(!player->HasAura(SPELL_ID))
        {
            const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_ID);
            player->GetSession()->SendNotification("You can't enter this area without %s", spellInfo->SpellName[player->GetSession()->GetSessionDbLocaleIndex()]);

            player->TeleportTo(1, 0.0f, 0.0f, 0.0f, 0.0f);
        }
    }
}

};
void AddSC_AreaCheck()
{
new AreaCheck();
}[/CODE]

Thanks Jameyboor , I do it with Ascathor way it’s simple .

Jameyboor way is pro and better result .

Thanks All /emoticons/default_wub.png , please set thread to solved or answered .