aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/DataStores/DBCEnums.h2
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp18
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;