diff options
author | tobmaps <spambot42@yandex.ru> | 2011-05-29 02:40:37 +0700 |
---|---|---|
committer | tobmaps <spambot42@yandex.ru> | 2011-05-29 02:40:37 +0700 |
commit | 9f1a4f33c05f67599c2b0568a81808ca8de0c9e3 (patch) | |
tree | 6b34e70ca428e92075144f54352dd99df900d33d /src | |
parent | fade2383ccebe7a3cce060e00a1a45fa28f1bd3a (diff) |
Core/Players: Implemented AREA_FLAG_ALLOW_DUELS. Duels should be possible only at areas with this flag. Tnx to Destalker for pointing out this flag
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/DataStores/DBCEnums.h | 2 | ||||
-rwxr-xr-x | src/server/game/Spells/SpellEffects.cpp | 18 |
2 files changed, 6 insertions, 14 deletions
diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 3555806ef41..6534bfedb83 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -239,7 +239,7 @@ enum AreaFlags AREA_FLAG_SLAVE_CAPITAL = 0x00000008, // city and city subsones AREA_FLAG_UNK3 = 0x00000010, // can't find common meaning AREA_FLAG_SLAVE_CAPITAL2 = 0x00000020, // slave capital city flag? - AREA_FLAG_UNK4 = 0x00000040, // many zones have this flag + AREA_FLAG_ALLOW_DUELS = 0x00000040, // allow to duel here AREA_FLAG_ARENA = 0x00000080, // arena, both instanced and world arenas AREA_FLAG_CAPITAL = 0x00000100, // main capital city flag AREA_FLAG_CITY = 0x00000200, // only for one zone named "City" (where it located?) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index c0bdaf394c9..58023ff9e52 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5397,24 +5397,16 @@ void Spell::EffectDuel(SpellEffIndex effIndex) if (caster->duel || target->duel || !target->GetSocial() || target->GetSocial()->HasIgnore(caster->GetGUIDLow())) return; - // Players can only fight a duel with each other outside (=not inside dungeons and not in capital cities) - // Don't have to check the target's map since you cannot challenge someone across maps - if (caster->GetMap()->Instanceable()) - //if (mapid != 0 && mapid != 1 && mapid != 530 && mapid != 571 && mapid != 609) + // Players can only fight a duel in zones with this flag + AreaTableEntry const* casterAreaEntry = GetAreaEntryByAreaID(caster->GetAreaId()); + if (casterAreaEntry && !(casterAreaEntry->flags & AREA_FLAG_ALLOW_DUELS)) { SendCastResult(SPELL_FAILED_NO_DUELING); // Dueling isn't allowed here return; } - AreaTableEntry const* casterAreaEntry = GetAreaEntryByAreaID(caster->GetZoneId()); - if (casterAreaEntry && (casterAreaEntry->flags & AREA_FLAG_CAPITAL)) - { - SendCastResult(SPELL_FAILED_NO_DUELING); // Dueling isn't allowed here - return; - } - - AreaTableEntry const* targetAreaEntry = GetAreaEntryByAreaID(target->GetZoneId()); - if (targetAreaEntry && (targetAreaEntry->flags & AREA_FLAG_CAPITAL)) + AreaTableEntry const* targetAreaEntry = GetAreaEntryByAreaID(target->GetAreaId()); + if (targetAreaEntry && !(targetAreaEntry->flags & AREA_FLAG_ALLOW_DUELS)) { SendCastResult(SPELL_FAILED_NO_DUELING); // Dueling isn't allowed here return; |