aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellMgr.cpp
diff options
context:
space:
mode:
authorSubv <s.v.h21@hotmail.com>2012-10-16 21:55:01 -0500
committerSubv <s.v.h21@hotmail.com>2012-10-16 21:55:01 -0500
commit705873091b470a5d0cd361bd7f295ec724141df2 (patch)
tree2b557293395baaf88d66a1fbac55b3919569c0fc /src/server/game/Spells/SpellMgr.cpp
parentb49891e348c01ae7f240ef07c05e09bc361f4c58 (diff)
parent27f091806a6f52f406837d188dd4171019bfa59b (diff)
Merge branch 'master' of https://github.com/TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Entities/Player/Player.cpp src/server/game/Handlers/TicketHandler.cpp src/server/game/Tickets/TicketMgr.cpp src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
Diffstat (limited to 'src/server/game/Spells/SpellMgr.cpp')
-rw-r--r--src/server/game/Spells/SpellMgr.cpp44
1 files changed, 15 insertions, 29 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index eb5c26a1c71..7fb518271cf 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -1061,12 +1061,9 @@ SpellAreaMapBounds SpellMgr::GetSpellAreaMapBounds(uint32 spell_id) const
return SpellAreaMapBounds(mSpellAreaMap.lower_bound(spell_id), mSpellAreaMap.upper_bound(spell_id));
}
-SpellAreaForQuestMapBounds SpellMgr::GetSpellAreaForQuestMapBounds(uint32 quest_id, bool active) const
+SpellAreaForQuestMapBounds SpellMgr::GetSpellAreaForQuestMapBounds(uint32 quest_id) const
{
- if (active)
- return SpellAreaForQuestMapBounds(mSpellAreaForActiveQuestMap.lower_bound(quest_id), mSpellAreaForActiveQuestMap.upper_bound(quest_id));
- else
- return SpellAreaForQuestMapBounds(mSpellAreaForQuestMap.lower_bound(quest_id), mSpellAreaForQuestMap.upper_bound(quest_id));
+ return SpellAreaForQuestMapBounds(mSpellAreaForQuestMap.lower_bound(quest_id), mSpellAreaForQuestMap.upper_bound(quest_id));
}
SpellAreaForQuestMapBounds SpellMgr::GetSpellAreaForQuestEndMapBounds(uint32 quest_id) const
@@ -1099,11 +1096,11 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
return false;
if (questStart) // not in expected required quest state
- if (!player || ((!questStartCanActive || !player->IsActiveQuest(questStart)) && !player->GetQuestRewardStatus(questStart)))
+ if (!player || (((1 << player->GetQuestStatus(questStart)) & questStartStatus) == 0))
return false;
if (questEnd) // not in expected forbidden quest state
- if (!player || player->GetQuestRewardStatus(questEnd))
+ if (!player || (((1 << player->GetQuestStatus(questEnd)) & questEndStatus) == 0))
return false;
if (auraSpell) // not have expected aura
@@ -2433,12 +2430,11 @@ void SpellMgr::LoadSpellAreas()
mSpellAreaMap.clear(); // need for reload case
mSpellAreaForQuestMap.clear();
- mSpellAreaForActiveQuestMap.clear();
mSpellAreaForQuestEndMap.clear();
mSpellAreaForAuraMap.clear();
- // 0 1 2 3 4 5 6 7 8
- QueryResult result = WorldDatabase.Query("SELECT spell, area, quest_start, quest_start_active, quest_end, aura_spell, racemask, gender, autocast FROM spell_area");
+ // 0 1 2 3 4 5 6 7 8 9
+ QueryResult result = WorldDatabase.Query("SELECT spell, area, quest_start, quest_start_status, quest_end_status, quest_end, aura_spell, racemask, gender, autocast FROM spell_area");
if (!result)
{
@@ -2457,12 +2453,13 @@ void SpellMgr::LoadSpellAreas()
spellArea.spellId = spell;
spellArea.areaId = fields[1].GetUInt32();
spellArea.questStart = fields[2].GetUInt32();
- spellArea.questStartCanActive = fields[3].GetBool();
- spellArea.questEnd = fields[4].GetUInt32();
- spellArea.auraSpell = fields[5].GetInt32();
- spellArea.raceMask = fields[6].GetUInt32();
- spellArea.gender = Gender(fields[7].GetUInt8());
- spellArea.autocast = fields[8].GetBool();
+ spellArea.questStartStatus = fields[3].GetUInt32();
+ spellArea.questEndStatus = fields[4].GetUInt32();
+ spellArea.questEnd = fields[5].GetUInt32();
+ spellArea.auraSpell = fields[6].GetInt32();
+ spellArea.raceMask = fields[7].GetUInt32();
+ spellArea.gender = Gender(fields[8].GetUInt8());
+ spellArea.autocast = fields[9].GetBool();
if (SpellInfo const* spellInfo = GetSpellInfo(spell))
{
@@ -2494,7 +2491,7 @@ void SpellMgr::LoadSpellAreas()
continue;
// duplicate by requirements
- ok =false;
+ ok = false;
break;
}
@@ -2524,12 +2521,6 @@ void SpellMgr::LoadSpellAreas()
sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell, spellArea.questEnd);
continue;
}
-
- if (spellArea.questEnd == spellArea.questStart && !spellArea.questStartCanActive)
- {
- sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have quest (%u) requirement for start and end in same time", spell, spellArea.questEnd);
- continue;
- }
}
if (spellArea.auraSpell)
@@ -2605,12 +2596,7 @@ void SpellMgr::LoadSpellAreas()
// for search at quest start/reward
if (spellArea.questStart)
- {
- if (spellArea.questStartCanActive)
- mSpellAreaForActiveQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart, sa));
- else
- mSpellAreaForQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart, sa));
- }
+ mSpellAreaForQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart, sa));
// for search at quest start/reward
if (spellArea.questEnd)