diff options
| author | Subv <s.v.h21@hotmail.com> | 2012-10-19 17:57:30 -0500 |
|---|---|---|
| committer | Subv <s.v.h21@hotmail.com> | 2012-10-19 17:57:30 -0500 |
| commit | 9dc2b7ecd566eea4115cea19a4036cfa49cce055 (patch) | |
| tree | f50c7015362ae2cad1dabb0bb6be83b63e56a0c7 /src/server/game/Spells | |
| parent | 972b41810330b287fc7c4172cf33878240cd25ce (diff) | |
| parent | 38ca1531d8738141c742d9b7f892a75af3283edd (diff) | |
Merge branch 'master' of https://github.com/TrinityCore/TrinityCore into mmaps
Diffstat (limited to 'src/server/game/Spells')
| -rwxr-xr-x | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 | ||||
| -rwxr-xr-x | src/server/game/Spells/Spell.cpp | 4 | ||||
| -rwxr-xr-x | src/server/game/Spells/SpellMgr.cpp | 48 | ||||
| -rwxr-xr-x | src/server/game/Spells/SpellMgr.h | 6 | ||||
| -rwxr-xr-x | src/server/game/Spells/SpellScript.h | 2 |
5 files changed, 27 insertions, 37 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 297b4df97c4..5e9e8cc090b 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2863,6 +2863,7 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode { target->RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING_FLY); target->GetMotionMaster()->MoveFall(); + target->m_movementInfo.SetFallTime(0); } Player* player = target->ToPlayer(); @@ -3254,9 +3255,8 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, target->SetCanFly(apply); if (!apply) { - target->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING); - target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING); target->m_movementInfo.SetFallTime(0); + target->RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING_FLY); } Player* player = target->ToPlayer(); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index a02fa2d3d1b..45c4338f03d 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5229,7 +5229,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_spellInfo->Id != 1842 || (m_targets.GetGOTarget() && m_targets.GetGOTarget()->GetGOInfo()->type != GAMEOBJECT_TYPE_TRAP)) if (m_caster->ToPlayer()->InBattleground() && // In Battleground players can use only flags and banners - !m_caster->ToPlayer()->CanUseBattlegroundObject()) + !m_caster->ToPlayer()->CanUseBattlegroundObject(m_targets.GetGOTarget())) return SPELL_FAILED_TRY_AGAIN; // get the lock entry @@ -5640,7 +5640,7 @@ SpellCastResult Spell::CheckCasterAuras() const break; } } - if (foundNotStun) + if (foundNotStun && m_spellInfo->Id != 22812) prevented_reason = SPELL_FAILED_STUNNED; } else diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index ec7359a7ba4..06f1187a833 100755 --- 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) @@ -3486,6 +3472,10 @@ void SpellMgr::LoadDbcDataCorrections() case 71085: // Mana Void (periodic aura) spellInfo->DurationIndex = 9; // 30 seconds (missing) break; + case 72015: // Frostbolt Volley (only heroic) + case 72016: // Frostbolt Volley (only heroic) + spellInfo->EffectRadiusIndex[2] = EFFECT_RADIUS_40_YARDS; + break; case 70936: // Summon Suppressor (needs target selection script) spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ANY; spellInfo->EffectImplicitTargetB[0] = 0; diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 9646bc9dabf..cec9d4650f5 100755 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -495,7 +495,8 @@ struct SpellArea int32 auraSpell; // spell aura must be applied for spell apply)if possitive) and it must not be applied in other case uint32 raceMask; // can be applied only to races Gender gender; // can be applied only to gender - bool questStartCanActive; // if true then quest start can be active (not only rewarded) + uint32 questStartStatus; // QuestStatus that quest_start must have in order to keep the spell + uint32 questEndStatus; // QuestStatus that the quest_end must have in order to keep the spell (if the quest_end's status is different than this, the spell will be dropped) bool autocast; // if true then auto applied at area enter, in other case just allowed to cast // helpers @@ -681,7 +682,7 @@ class SpellMgr // Spell area SpellAreaMapBounds GetSpellAreaMapBounds(uint32 spell_id) const; - SpellAreaForQuestMapBounds GetSpellAreaForQuestMapBounds(uint32 quest_id, bool active) const; + SpellAreaForQuestMapBounds GetSpellAreaForQuestMapBounds(uint32 quest_id) const; SpellAreaForQuestMapBounds GetSpellAreaForQuestEndMapBounds(uint32 quest_id) const; SpellAreaForAuraMapBounds GetSpellAreaForAuraMapBounds(uint32 spell_id) const; SpellAreaForAreaMapBounds GetSpellAreaForAreaMapBounds(uint32 area_id) const; @@ -740,7 +741,6 @@ class SpellMgr EnchantCustomAttribute mEnchantCustomAttr; SpellAreaMap mSpellAreaMap; SpellAreaForQuestMap mSpellAreaForQuestMap; - SpellAreaForQuestMap mSpellAreaForActiveQuestMap; SpellAreaForQuestMap mSpellAreaForQuestEndMap; SpellAreaForAuraMap mSpellAreaForAuraMap; SpellAreaForAreaMap mSpellAreaForAreaMap; diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index c8126f8aaf3..b1a2097a8f9 100755 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -586,7 +586,7 @@ class AuraScript : public _SpellScript uint8 _currentScriptState; bool _defaultActionPrevented; ScriptStateStore(uint8 currentScriptState, AuraApplication const* auraApplication, bool defaultActionPrevented) - : _currentScriptState(currentScriptState), _auraApplication(auraApplication), _defaultActionPrevented(defaultActionPrevented) + : _auraApplication(auraApplication), _currentScriptState(currentScriptState), _defaultActionPrevented(defaultActionPrevented) {} }; typedef std::stack<ScriptStateStore> ScriptStateStack; |
