From c71fc301ec027da6b6a0014bf616cf6becfae00d Mon Sep 17 00:00:00 2001 From: Ambal Date: Wed, 23 Sep 2009 22:26:21 +0300 Subject: [PATCH 01/15] [8527] Make Spell::FillAreaTargets() code use new cell search algorithm Signed-off-by: Ambal --- src/game/Spell.cpp | 4 ++-- src/shared/revision_nr.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 4bd0a31fb..f6785f229 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -5910,8 +5910,8 @@ void Spell::FillAreaTargets( UnitList& TagUnitMap, float x, float y, float radiu TypeContainerVisitor world_notifier(notifier); TypeContainerVisitor grid_notifier(notifier); CellLock cell_lock(cell, p); - cell_lock->Visit(cell_lock, world_notifier, *m_caster->GetMap()); - cell_lock->Visit(cell_lock, grid_notifier, *m_caster->GetMap()); + cell_lock->Visit(cell_lock, world_notifier, *m_caster->GetMap(), *m_caster, radius); + cell_lock->Visit(cell_lock, grid_notifier, *m_caster->GetMap(), *m_caster, radius); } void Spell::FillRaidOrPartyTargets( UnitList &TagUnitMap, Unit* member, Unit* center, float radius, bool raid, bool withPets, bool withcaster ) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 58fc7f3ed..495a7f004 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8526" + #define REVISION_NR "8527" #endif // __REVISION_NR_H__ From b24e9de324dd95c0277c536a5dc7e88b34232fc1 Mon Sep 17 00:00:00 2001 From: Ambal Date: Fri, 25 Sep 2009 10:29:23 +0300 Subject: [PATCH 02/15] [8528] Implementing implicit target 49, 50. Thanks to qsa. Signed-off-by: Ambal --- src/game/SharedDefines.h | 4 +++- src/game/Spell.cpp | 23 ++++++++++++++++++++++- src/shared/revision_nr.h | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index abc6ea6f1..53948c756 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -1041,8 +1041,10 @@ enum Targets TARGET_TOTEM_FIRE = 44, TARGET_CHAIN_HEAL = 45, TARGET_SCRIPT_COORDINATES = 46, - TARGET_DYNAMIC_OBJECT = 47, + TARGET_DYNAMIC_OBJECT_FRONT = 47, TARGET_SUMMON = 48, + TARGET_DYNAMIC_OBJECT_LEFT_SIDE = 49, + TARGET_DYNAMIC_OBJECT_RIGHT_SIDE = 50, TARGET_AREAEFFECT_CUSTOM_2 = 52, TARGET_CURRENT_ENEMY_COORDINATES = 53, // set unit coordinates as dest, only 16 target B imlemented TARGET_ALL_RAID_AROUND_CASTER = 56, diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index f6785f229..33e9f7f7d 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1319,7 +1319,6 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap) case TARGET_TOTEM_FIRE: case TARGET_SELF: case TARGET_SELF2: - case TARGET_DYNAMIC_OBJECT: case TARGET_AREAEFFECT_CUSTOM: case TARGET_AREAEFFECT_CUSTOM_2: case TARGET_SUMMON: @@ -1986,6 +1985,28 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap) if(DynamicObject* dynObj = m_caster->GetDynObject(m_triggeredByAuraSpell ? m_triggeredByAuraSpell->Id : m_spellInfo->Id)) m_targets.setDestination(dynObj->GetPositionX(), dynObj->GetPositionY(), dynObj->GetPositionZ()); break; + + case TARGET_DYNAMIC_OBJECT_FRONT: + case TARGET_DYNAMIC_OBJECT_LEFT_SIDE: + case TARGET_DYNAMIC_OBJECT_RIGHT_SIDE: + if (!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)) + { + float angle = m_caster->GetOrientation(); + switch(targetMode) + { + case TARGET_DYNAMIC_OBJECT_FRONT: break; + case TARGET_DYNAMIC_OBJECT_LEFT_SIDE: angle -= 3*M_PI/4; break; + case TARGET_DYNAMIC_OBJECT_RIGHT_SIDE: angle += 3*M_PI/4; break; + } + + float x,y; + m_caster->GetNearPoint2D(x,y,radius,angle); + m_targets.setDestination(x,y,m_caster->GetPositionZ()); + } + + TagUnitMap.push_back(m_caster); + break; + case TARGET_POINT_AT_NORTH: case TARGET_POINT_AT_SOUTH: case TARGET_POINT_AT_EAST: diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 495a7f004..5a35397de 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8527" + #define REVISION_NR "8528" #endif // __REVISION_NR_H__ From d937b18dbe565463907160db56b0342dbf886280 Mon Sep 17 00:00:00 2001 From: Ambal Date: Fri, 25 Sep 2009 14:28:43 +0300 Subject: [PATCH 03/15] [8529] check rune cost only if spell has PowerType == POWER_RUNE. Patch provided by yavi. Signed-off-by: Ambal --- src/game/Spell.cpp | 10 +++++++--- src/shared/revision_nr.h | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 33e9f7f7d..b5fac2632 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -5075,9 +5075,13 @@ SpellCastResult Spell::CheckPower() return SPELL_FAILED_UNKNOWN; } - SpellCastResult failReason = CheckRuneCost(m_spellInfo->runeCostID); - if(failReason != SPELL_CAST_OK) - return failReason; + //check rune cost only if a spell has PowerType == POWER_RUNE + if(m_spellInfo->powerType == POWER_RUNE) + { + SpellCastResult failReason = CheckRuneCost(m_spellInfo->runeCostID); + if(failReason != SPELL_CAST_OK) + return failReason; + } // Check power amount Powers powerType = Powers(m_spellInfo->powerType); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 5a35397de..9cc528464 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8528" + #define REVISION_NR "8529" #endif // __REVISION_NR_H__ From a2d1781ba88f7047c7ba9e7c5169f3ead28957cc Mon Sep 17 00:00:00 2001 From: Maxxie Date: Fri, 25 Sep 2009 15:11:47 +0300 Subject: [PATCH 04/15] [8530] Correctly restore powers with energize-effect spells like Shadowfiend or Mana Tide Totem Signed-off-by: Ambal --- src/game/Unit.cpp | 2 +- src/shared/revision_nr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 96d1d8c8a..141e8b68f 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8075,7 +8075,7 @@ void Unit::EnergizeBySpell(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers { SendEnergizeSpellLog(pVictim, SpellID, Damage, powertype); // needs to be called after sending spell log - ModifyPower(powertype, Damage); + pVictim->ModifyPower(powertype, Damage); } uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 9cc528464..2fff78f36 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8529" + #define REVISION_NR "8530" #endif // __REVISION_NR_H__ From 49c97633b8434be7af508ecc9f155ea147df9301 Mon Sep 17 00:00:00 2001 From: Shendor Date: Fri, 25 Sep 2009 15:36:43 +0300 Subject: [PATCH 05/15] [8531] Fixed spell 20594 Signed-off-by: Ambal --- src/game/Spell.cpp | 2 ++ src/shared/revision_nr.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index b5fac2632..0102b1a95 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2412,6 +2412,8 @@ void Spell::cast(bool skipCheck) else if(m_spellInfo->SpellIconID == 1662 && m_spellInfo->AttributesEx & 0x20) // Blood Fury (Racial) AddPrecastSpell(23230); // Blood Fury - Healing Reduction + else if(m_spellInfo->Id == 20594) // Stoneskin + AddTriggeredSpell(65116); // Stoneskin - armor 10% for 8 sec break; } case SPELLFAMILY_MAGE: diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 2fff78f36..c78be8ee6 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8530" + #define REVISION_NR "8531" #endif // __REVISION_NR_H__ From 1bf0678ebd5ccf4e0de9e060b6b8cde9ce123119 Mon Sep 17 00:00:00 2001 From: Antonio593 Date: Fri, 25 Sep 2009 15:53:02 +0300 Subject: [PATCH 06/15] [8532] Fixed situation where some items like 42947 were not giving spell power bonus Signed-off-by: Ambal --- src/game/Player.cpp | 7 +++++++ src/shared/revision_nr.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index b8c4449cc..c47cfd79b 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -6689,6 +6689,13 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl } } + // Apply Spell Power from ScalingStatValue if set + if(ssv) + { + if (int32 spellbonus = ssv->getSpellBonus(proto->ScalingStatValue)) + ApplySpellPowerBonus(spellbonus, apply); + } + // If set ScalingStatValue armor get it or use item armor uint32 armor = proto->Armor; if (ssv) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index c78be8ee6..7773ed4ec 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8531" + #define REVISION_NR "8532" #endif // __REVISION_NR_H__ From 38aac1a77acbd63c293750aaaecd75e4259ec8bd Mon Sep 17 00:00:00 2001 From: NoFantasy Date: Fri, 25 Sep 2009 16:01:57 +0200 Subject: [PATCH 07/15] [8533] Not remove timed quest and correctly fail when time runs out. Add function to remove timed quest instead of direct access to set. Signed-off-by: NoFantasy --- src/game/Player.cpp | 20 +++++++------------- src/game/Player.h | 2 ++ src/game/QuestHandler.cpp | 6 ++++++ src/shared/revision_nr.h | 2 +- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index c47cfd79b..6d08b8e63 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -12602,9 +12602,7 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver DestroyItemCount( pQuest->ReqItemId[i], pQuest->ReqItemCount[i], true); } - //if( qInfo->HasSpecialFlag( QUEST_FLAGS_TIMED ) ) - // SetTimedQuest( 0 ); - m_timedquests.erase(pQuest->GetQuestId()); + RemoveTimedQuest(quest_id); if (pQuest->GetRewChoiceItemsCount() > 0) { @@ -12811,6 +12809,7 @@ void Player::FailQuest(uint32 questId) { QuestStatusData& q_status = mQuestStatus[questId]; + RemoveTimedQuest(questId); q_status.m_timer = 0; SendQuestTimerFailed(questId); @@ -13036,12 +13035,13 @@ bool Player::SatisfyQuestStatus( Quest const* qInfo, bool msg ) return true; } -bool Player::SatisfyQuestTimed( Quest const* qInfo, bool msg ) +bool Player::SatisfyQuestTimed(Quest const* qInfo, bool msg) { - if ( (find(m_timedquests.begin(), m_timedquests.end(), qInfo->GetQuestId()) != m_timedquests.end()) && qInfo->HasFlag(QUEST_MANGOS_FLAGS_TIMED) ) + if (!m_timedquests.empty() && qInfo->HasFlag(QUEST_MANGOS_FLAGS_TIMED)) { - if( msg ) - SendCanTakeQuestResponse( INVALIDREASON_QUEST_ONLY_ONE_TIMED ); + if (msg) + SendCanTakeQuestResponse(INVALIDREASON_QUEST_ONLY_ONE_TIMED); + return false; } return true; @@ -13269,12 +13269,6 @@ void Player::SetQuestStatus(uint32 quest_id, QuestStatus status) { if (Quest const* qInfo = objmgr.GetQuestTemplate(quest_id)) { - if (status == QUEST_STATUS_NONE || status == QUEST_STATUS_INCOMPLETE || status == QUEST_STATUS_COMPLETE || status == QUEST_STATUS_FAILED) - { - if (qInfo->HasFlag(QUEST_MANGOS_FLAGS_TIMED)) - m_timedquests.erase(qInfo->GetQuestId()); - } - QuestStatusData& q_status = mQuestStatus[quest_id]; q_status.m_status = status; diff --git a/src/game/Player.h b/src/game/Player.h index b8973fb9c..89a6421d3 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1363,6 +1363,7 @@ class MANGOS_DLL_SPEC Player : public Unit void SetInGameTime( uint32 time ) { m_ingametime = time; }; void AddTimedQuest( uint32 quest_id ) { m_timedquests.insert(quest_id); } + void RemoveTimedQuest( uint32 quest_id ) { m_timedquests.erase(quest_id); } /*********************************************************/ /*** LOAD SYSTEM ***/ @@ -2249,6 +2250,7 @@ class MANGOS_DLL_SPEC Player : public Unit /*** QUEST SYSTEM ***/ /*********************************************************/ + //We allow only one timed quest active at the same time. Below can then be simple value instead of set. std::set m_timedquests; uint64 m_divider; diff --git a/src/game/QuestHandler.cpp b/src/game/QuestHandler.cpp index c886a2a0d..1cef7dd22 100644 --- a/src/game/QuestHandler.cpp +++ b/src/game/QuestHandler.cpp @@ -350,6 +350,12 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data) if(!_player->TakeQuestSourceItem( quest, true )) return; // can't un-equip some items, reject quest cancel + if (const Quest *pQuest = objmgr.GetQuestTemplate(quest)) + { + if (pQuest->HasFlag(QUEST_MANGOS_FLAGS_TIMED)) + _player->RemoveTimedQuest(quest); + } + _player->SetQuestStatus( quest, QUEST_STATUS_NONE); } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 7773ed4ec..deab694c5 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8532" + #define REVISION_NR "8533" #endif // __REVISION_NR_H__ From 0c051485d9e970584062e431d1047d136be70340 Mon Sep 17 00:00:00 2001 From: qsa Date: Fri, 25 Sep 2009 18:14:37 +0300 Subject: [PATCH 08/15] [8534] Add error output to track unhandled targetMode values in Spell::SetTargetMap() Signed-off-by: Ambal --- src/game/Spell.cpp | 2 ++ src/shared/revision_nr.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 0102b1a95..f7dc9faae 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2205,12 +2205,14 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap) TagUnitMap.push_back(owner); } break; + default: break; } break; } default: + sLog.outError( "SPELL: Unknown implicit target (%u) for spell ID %u", targetMode, m_spellInfo->Id ); break; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index deab694c5..914b5ca37 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8533" + #define REVISION_NR "8534" #endif // __REVISION_NR_H__ From b72fe466e12f2989ecf1f578d465e59eefde72da Mon Sep 17 00:00:00 2001 From: SilverIce Date: Fri, 25 Sep 2009 19:56:48 +0300 Subject: [PATCH 09/15] [8535] Correctly show spell sharges/stack amount Signed-off-by: Ambal --- src/game/Player.cpp | 5 ++++- src/shared/revision_nr.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 6d08b8e63..63f6a3405 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -18481,7 +18481,10 @@ void Player::SendAurasForTarget(Unit *target) // level data << uint8(aura->GetAuraLevel()); // charges - data << uint8(aura->GetAuraCharges()); + if (aura->GetAuraCharges()) + data << uint8(aura->GetAuraCharges() * aura->GetStackAmount()); + else + data << uint8(aura->GetStackAmount()); if(!(auraFlags & AFLAG_NOT_CASTER)) { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 914b5ca37..c80652735 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8534" + #define REVISION_NR "8535" #endif // __REVISION_NR_H__ From 19e28af2f068655a37c147b5475fabc233ae4112 Mon Sep 17 00:00:00 2001 From: zergtmn Date: Fri, 25 Sep 2009 20:05:03 +0300 Subject: [PATCH 10/15] [8536] Fixed spell 62776 Signed-off-by: Ambal --- src/game/SpellEffects.cpp | 8 ++++++++ src/shared/revision_nr.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index b644e1f16..be7318945 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -348,8 +348,16 @@ void Spell::EffectSchoolDMG(uint32 effect_idx) } // Cataclysmic Bolt case 38441: + { damage = unitTarget->GetMaxHealth() / 2; break; + } + // Tympanic Tantrum + case 62775: + { + damage = unitTarget->GetMaxHealth() / 10; + break; + } } break; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index c80652735..5656bb579 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8535" + #define REVISION_NR "8536" #endif // __REVISION_NR_H__ From f8047e9da006f6d159b8fc37aefb995ff5e1ab43 Mon Sep 17 00:00:00 2001 From: Shendor Date: Fri, 25 Sep 2009 20:19:03 +0300 Subject: [PATCH 11/15] [8537] Implement SPELL_AURA_MOD_CRIT_CHANCE for spell 31858 Signed-off-by: Ambal --- src/game/SpellAuraDefines.h | 2 +- src/game/SpellAuras.cpp | 8 +++++++- src/game/SpellAuras.h | 1 + src/game/StatSystem.cpp | 2 ++ src/shared/revision_nr.h | 2 +- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h index 9254468ca..602a3050b 100644 --- a/src/game/SpellAuraDefines.h +++ b/src/game/SpellAuraDefines.h @@ -332,7 +332,7 @@ enum AuraType SPELL_AURA_DEFLECT_SPELLS, SPELL_AURA_288, SPELL_AURA_289, - SPELL_AURA_290, + SPELL_AURA_MOD_ALL_CRIT_CHANCE, SPELL_AURA_291, SPELL_AURA_292, SPELL_AURA_293, diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 42e88b83f..3d00d08c9 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -340,7 +340,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleNoImmediateEffect, //287 SPELL_AURA_DEFLECT_SPELLS implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult &Aura::HandleUnused, //288 not used by any spells (3.09) except 1 test spell. &Aura::HandleUnused, //289 unused - &Aura::HandleUnused, //290 unused + &Aura::HandleAuraModAllCritChance, //290 SPELL_AURA_MOD_ALL_CRIT_CHANCE &Aura::HandleUnused, //291 unused &Aura::HandleNULL, //292 call stabled pet &Aura::HandleNULL, //293 2 test spells @@ -7405,3 +7405,9 @@ void Aura::HandleModTargetArmorPct(bool apply, bool Real) ((Player*)m_target)->UpdateArmorPenetration(); } + +void Aura::HandleAuraModAllCritChance(bool apply, bool Real) +{ + this->HandleAuraModCritPercent(apply, Real); + this->HandleModSpellCritChance(apply, Real); +} diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 053d24547..397338227 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -212,6 +212,7 @@ class MANGOS_DLL_SPEC Aura void HandleNoReagentUseAura(bool Apply, bool Real); void HandlePhase(bool Apply, bool Real); void HandleModTargetArmorPct(bool Apply, bool Real); + void HandleAuraModAllCritChance(bool Apply, bool Real); virtual ~Aura(); diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index c305e9e74..32dc01b1d 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -586,6 +586,8 @@ void Player::UpdateSpellCritChance(uint32 school) crit += GetSpellCritFromIntellect(); // Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE crit += GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE); + // Increase crit from SPELL_AURA_MOD_ALL_CRIT_CHANCE + crit += GetTotalAuraModifier(SPELL_AURA_MOD_ALL_CRIT_CHANCE); // Increase crit by school from SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL crit += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, 1< Date: Fri, 25 Sep 2009 20:43:19 +0300 Subject: [PATCH 12/15] [8538] Fixed spell 63375 Signed-off-by: Ambal --- src/game/Unit.cpp | 6 ++++++ src/shared/revision_nr.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 141e8b68f..503b19b62 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7104,6 +7104,12 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB return false; break; } + // Improved Stormstrike + case 63375: + { + basepoints[0] = int32(GetCreateMana() * 0.20f); + break; + } // Brain Freeze case 57761: { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index fa558880e..f0bbcc4a4 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8537" + #define REVISION_NR "8538" #endif // __REVISION_NR_H__ From a84f2cba63a4c585ba2dede1538e5a9593861306 Mon Sep 17 00:00:00 2001 From: Astellar Date: Fri, 25 Sep 2009 23:21:25 +0300 Subject: [PATCH 13/15] [8539] Check pet aura range at area aura update Signed-off-by: Ambal --- src/game/SpellAuras.cpp | 2 +- src/shared/revision_nr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 3d00d08c9..ff6d7917a 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -772,7 +772,7 @@ void AreaAura::Update(uint32 diff) case AREA_AURA_OWNER: case AREA_AURA_PET: { - if(owner != caster) + if(owner != caster && caster->IsWithinDistInMap(owner, m_radius)) targets.push_back(owner); break; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index f0bbcc4a4..81e70c6d3 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8538" + #define REVISION_NR "8539" #endif // __REVISION_NR_H__ From eb46131715551080d2ee2356ad0239452ae0b72c Mon Sep 17 00:00:00 2001 From: ApoC Date: Fri, 25 Sep 2009 23:05:46 +0200 Subject: [PATCH 14/15] [8540] Revert "[8538] Fixed spell 63375" due to patch incorrectness. Revert suggested by Vladimir. This reverts commit 6217b913c35563f68ea3c414367cd7ac84236b3e. Signed-off-by: ApoC --- src/game/Unit.cpp | 6 ------ src/shared/revision_nr.h | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 503b19b62..141e8b68f 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7104,12 +7104,6 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB return false; break; } - // Improved Stormstrike - case 63375: - { - basepoints[0] = int32(GetCreateMana() * 0.20f); - break; - } // Brain Freeze case 57761: { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 81e70c6d3..416038c68 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8539" + #define REVISION_NR "8540" #endif // __REVISION_NR_H__ From c78be3fc741f942562d12efaa24509ea6d8e6e0f Mon Sep 17 00:00:00 2001 From: qsa Date: Sat, 26 Sep 2009 09:29:38 +0300 Subject: [PATCH 15/15] [8541] Implement implicit target types TARGET_RANDOM_NEARBY_LOC(72) and TARGET_RANDOM_NEARBY_DEST(86). Some summon spells should work fine now Signed-off-by: Ambal --- src/game/SharedDefines.h | 2 ++ src/game/Spell.cpp | 28 ++++++++++++++++++++++++++++ src/shared/revision_nr.h | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 53948c756..bf03c458a 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -1052,6 +1052,7 @@ enum Targets TARGET_AREAEFFECT_PARTY_AND_CLASS = 61, TARGET_DUELVSPLAYER_COORDINATES = 63, TARGET_BEHIND_VICTIM = 65, // uses in teleport behind spells, caster/target dependent from spell effect + TARGET_RANDOM_NEARBY_LOC = 72, // uses in teleport onto nearby locations TARGET_DYNAMIC_OBJECT_COORDINATES = 76, TARGET_SINGLE_ENEMY = 77, TARGET_POINT_AT_NORTH = 78, // 78-85 possible _COORDINATES at radius with pi/4 step around target in unknown order, N? @@ -1062,6 +1063,7 @@ enum Targets TARGET_POINT_AT_NW = 83, // from spell desc: "(NW)" TARGET_POINT_AT_SE = 84, // from spell desc: "(SE)" TARGET_POINT_AT_SW = 85, // from spell desc: "(SW)" + TARGET_RANDOM_NEARBY_DEST = 86, // "Test Nearby Dest Random" - random around selected destination TARGET_SELF2 = 87, TARGET_DIRECTLY_FORWARD = 89, TARGET_NONCOMBAT_PET = 90, diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index f7dc9faae..78215f983 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1313,6 +1313,34 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap) switch(targetMode) { + case TARGET_RANDOM_NEARBY_LOC: + { + float dest_x = m_caster->GetPositionX() + irand(-radius, radius); + float dest_y = m_caster->GetPositionY() + irand(-radius, radius); + float dest_z = m_caster->GetMap()->GetHeight(dest_x, dest_y, MAX_HEIGHT); + m_targets.setDestination(dest_x, dest_y, dest_z); + + TagUnitMap.push_back(m_caster); + break; + } + case TARGET_RANDOM_NEARBY_DEST: + { + float dest_x = m_targets.m_destX + irand(-radius, radius); + float dest_y = m_targets.m_destY + irand(-radius, radius); + float dest_z = m_caster->GetMap()->GetHeight(dest_x, dest_y, MAX_HEIGHT); + m_targets.setDestination(dest_x, dest_y, dest_z); + + if (radius > 0.0f) + { + // caster included here? + FillAreaTargets(TagUnitMap, dest_x, dest_y, radius, PUSH_DEST_CENTER, SPELL_TARGETS_AOE_DAMAGE); + } + else + TagUnitMap.push_back(m_caster); + + break; + } + case TARGET_TOTEM_EARTH: case TARGET_TOTEM_WATER: case TARGET_TOTEM_AIR: diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 416038c68..b49806524 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8540" + #define REVISION_NR "8541" #endif // __REVISION_NR_H__