aboutsummaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authormaximius <none@none>2009-10-09 20:48:55 -0700
committermaximius <none@none>2009-10-09 20:48:55 -0700
commitb4c7a2514d9844fccc46fc78aee0b34d1b26161e (patch)
tree6721c91c521fc3aa86dd6786877b1742b77b0e2c /src/game
parent3ccc348b099467441bb954147cd997fb42861951 (diff)
*Blackfathom Deeps - Event: Aku'mai, by Tartalo
*Split Personality Achivement, by Destalker *Halls of Lightning Fixes, by Destalker Volkhan fixes + Achievement Ionar Fix - without this he resets each time he is invisible, spamming sparks Arcing Burn - should be a debuff (and stackable, stackable part NYI :/) *Naxxramas - Thaddius - the aura shall affect only the character without the proper aura, by Trazom *Naxxramas - Kelthuzad - some timer adjustments (may need verification or tweaking) by Cass *Merges by Stryker, thanks to all authors and testers. [8458] Re-implement SPELL_AURA_MOD_TARGET_ARMOR_PCT in more porper way for weapon dependent cases. Author: VladimirMangos [8459] Avoid mutiply apply weapon dependent armor penetration bonus for each weapon. Author: VladimirMangos [8529] check rune cost only if spell has PowerType == POWER_RUNE. Patch provided by yavi. Author: Ambal [8532] Fixed situation where some items like 42947 were not giving spell power bonus. By: Ambal [8533] Not remove timed quest and correctly fail when time runs out. Add function to remove timed quest instead of direct access to set. Author: NoFantasy [8536] Fixed spell 62776. By: Ambal [8539] Check pet aura range at area aura update. By: Ambal [8546] Implement battleground bonusweekends call to arms. Also fix typo in auctionmgr. Author: balrok [8547] Implemented scriptcall: CorpseRemoved(uint32 & /*respawnDelay*/) it will be called when the corpse of the scripted creature get's removed, it's possible to adjust the next respawn inside the script. Author: balrok [8561] Replace another auras code call by explicit code [8566] avoid singleton-lock when accessing BattleGroundMGR::isBGWeekend() Proposed by vladimir. Comitter: balrok --HG-- branch : trunk
Diffstat (limited to 'src/game')
-rw-r--r--src/game/AuctionHouseMgr.cpp4
-rw-r--r--src/game/BattleGroundAB.cpp6
-rw-r--r--src/game/BattleGroundEY.cpp4
-rw-r--r--src/game/BattleGroundMgr.cpp17
-rw-r--r--src/game/BattleGroundMgr.h2
-rw-r--r--src/game/BattleGroundWS.cpp3
-rw-r--r--src/game/Creature.cpp4
-rw-r--r--src/game/CreatureAI.h3
-rw-r--r--src/game/Player.cpp48
-rw-r--r--src/game/Player.h8
-rw-r--r--src/game/QuestHandler.cpp6
-rw-r--r--src/game/SharedDefines.h4
-rw-r--r--src/game/Spell.cpp12
-rw-r--r--src/game/SpellAuraDefines.h2
-rw-r--r--src/game/SpellAuras.cpp27
-rw-r--r--src/game/SpellAuras.h1
-rw-r--r--src/game/SpellEffects.cpp11
-rw-r--r--src/game/SpellMgr.cpp2
-rw-r--r--src/game/StatSystem.cpp32
-rw-r--r--src/game/Unit.cpp4
20 files changed, 159 insertions, 41 deletions
diff --git a/src/game/AuctionHouseMgr.cpp b/src/game/AuctionHouseMgr.cpp
index 294beed2fb7..4fb8398e694 100644
--- a/src/game/AuctionHouseMgr.cpp
+++ b/src/game/AuctionHouseMgr.cpp
@@ -295,7 +295,7 @@ void AuctionHouseMgr::LoadAuctionItems()
if (!proto)
{
- sLog.outError("ObjectMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid,item_template);
+ sLog.outError("AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid,item_template);
continue;
}
@@ -404,7 +404,7 @@ void AuctionHouseMgr::LoadAuctions()
}
// check if sold item exists for guid
- // and item_template in fact (GetAItem will fail if problematic in result check in ObjectMgr::LoadAuctionItems)
+ // and item_template in fact (GetAItem will fail if problematic in result check in AuctionHouseMgr::LoadAuctionItems)
if (!GetAItem(aItem->item_guidlow))
{
aItem->DeleteFromDB();
diff --git a/src/game/BattleGroundAB.cpp b/src/game/BattleGroundAB.cpp
index adf480d6f97..39b7d06e0ce 100644
--- a/src/game/BattleGroundAB.cpp
+++ b/src/game/BattleGroundAB.cpp
@@ -18,10 +18,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "ObjectMgr.h"
#include "World.h"
#include "WorldPacket.h"
-
+#include "GameObject.h"
+#include "BattleGroundMgr.h"
#include "BattleGround.h"
#include "BattleGroundAB.h"
#include "Creature.h"
@@ -593,7 +593,7 @@ void BattleGroundAB::Reset()
m_ReputationScoreTics[BG_TEAM_ALLIANCE] = 0;
m_ReputationScoreTics[BG_TEAM_HORDE] = 0;
m_IsInformedNearVictory = false;
- bool isBGWeekend = false; //TODO FIXME - call sBattleGroundMgr.IsBGWeekend(m_TypeID); - you must also implement that call!
+ bool isBGWeekend = sBattleGroundMgr.IsBGWeekend(GetTypeID());
m_HonorTics = (isBGWeekend) ? BG_AB_ABBGWeekendHonorTicks : BG_AB_NotABBGWeekendHonorTicks;
m_ReputationTics = (isBGWeekend) ? BG_AB_ABBGWeekendReputationTicks : BG_AB_NotABBGWeekendReputationTicks;
m_TeamScores500Disadvantage[BG_TEAM_ALLIANCE] = false;
diff --git a/src/game/BattleGroundEY.cpp b/src/game/BattleGroundEY.cpp
index 78654677230..0c7ea66388b 100644
--- a/src/game/BattleGroundEY.cpp
+++ b/src/game/BattleGroundEY.cpp
@@ -21,7 +21,7 @@
#include "ObjectMgr.h"
#include "World.h"
#include "WorldPacket.h"
-
+#include "BattleGroundMgr.h"
#include "BattleGround.h"
#include "BattleGroundEY.h"
#include "Creature.h"
@@ -529,7 +529,7 @@ void BattleGroundEY::Reset()
m_DroppedFlagGUID = 0;
m_PointAddingTimer = 0;
m_TowerCapCheckTimer = 0;
- bool isBGWeekend = false; //TODO FIXME - call sBattleGroundMgr.IsBGWeekend(m_TypeID); - you must also implement that call!
+ bool isBGWeekend = sBattleGroundMgr.IsBGWeekend(GetTypeID());
m_HonorTics = (isBGWeekend) ? BG_EY_EYWeekendHonorTicks : BG_EY_NotEYWeekendHonorTicks;
for(uint8 i = 0; i < EY_POINTS_MAX; ++i)
diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp
index 64972c0c97f..d1f5d71942f 100644
--- a/src/game/BattleGroundMgr.cpp
+++ b/src/game/BattleGroundMgr.cpp
@@ -42,6 +42,7 @@
#include "MapInstanced.h"
#include "MapManager.h"
#include "Player.h"
+#include "GameEventMgr.h"
#include "ProgressBar.h"
#include "SharedDefines.h"
@@ -2113,3 +2114,19 @@ void BattleGroundMgr::LoadBattleMastersEntry()
sLog.outString();
sLog.outString( ">> Loaded %u battlemaster entries", count );
}
+bool BattleGroundMgr::IsBGWeekend(BattleGroundTypeId bgTypeId)
+{
+ switch (bgTypeId)
+ {
+ case BATTLEGROUND_AV:
+ return IsHolidayActive(HOLIDAY_CALL_TO_ARMS_AV);
+ case BATTLEGROUND_EY:
+ return IsHolidayActive(HOLIDAY_CALL_TO_ARMS_EY);
+ case BATTLEGROUND_WS:
+ return IsHolidayActive(HOLIDAY_CALL_TO_ARMS_WS);
+ case BATTLEGROUND_SA:
+ return IsHolidayActive(HOLIDAY_CALL_TO_ARMS_SA);
+ default:
+ return false;
+ }
+}
diff --git a/src/game/BattleGroundMgr.h b/src/game/BattleGroundMgr.h
index c16de449f54..9100142ebd0 100644
--- a/src/game/BattleGroundMgr.h
+++ b/src/game/BattleGroundMgr.h
@@ -248,6 +248,8 @@ class BattleGroundMgr
static BattleGroundQueueTypeId BGQueueTypeId(BattleGroundTypeId bgTypeId, uint8 arenaType);
static BattleGroundTypeId BGTemplateId(BattleGroundQueueTypeId bgQueueTypeId);
static uint8 BGArenaType(BattleGroundQueueTypeId bgQueueTypeId);
+
+ static bool IsBGWeekend(BattleGroundTypeId bgTypeId);
private:
BattleMastersMap mBattleMastersMap;
diff --git a/src/game/BattleGroundWS.cpp b/src/game/BattleGroundWS.cpp
index 81080284b9d..ec19308e71f 100644
--- a/src/game/BattleGroundWS.cpp
+++ b/src/game/BattleGroundWS.cpp
@@ -25,6 +25,7 @@
#include "Language.h"
#include "Object.h"
#include "ObjectMgr.h"
+#include "BattleGroundMgr.h"
#include "Player.h"
#include "World.h"
#include "WorldPacket.h"
@@ -679,7 +680,7 @@ void BattleGroundWS::Reset()
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE;
m_TeamScores[BG_TEAM_ALLIANCE] = 0;
m_TeamScores[BG_TEAM_HORDE] = 0;
- bool isBGWeekend = false; //TODO FIXME - call sBattleGroundMgr.IsBGWeekend(m_TypeID); - you must also implement that call!
+ bool isBGWeekend = sBattleGroundMgr.IsBGWeekend(GetTypeID());
m_ReputationCapture = (isBGWeekend) ? 45 : 35;
m_HonorWinKills = (isBGWeekend) ? 3 : 1;
m_HonorEndKills = (isBGWeekend) ? 4 : 2;
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 5c3bf884e21..cc2bc64ae39 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -235,6 +235,10 @@ void Creature::RemoveCorpse()
setDeathState(DEAD);
ObjectAccessor::UpdateObjectVisibility(this);
loot.clear();
+ uint32 respawnDelay = m_respawnDelay;
+ if (AI())
+ AI()->CorpseRemoved(respawnDelay);
+
m_respawnTime = time(NULL) + m_respawnDelay;
float x,y,z,o;
diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h
index 791c4a96ca8..556e9be14e0 100644
--- a/src/game/CreatureAI.h
+++ b/src/game/CreatureAI.h
@@ -157,6 +157,9 @@ class TRINITY_DLL_SPEC CreatureAI : public UnitAI
// Is unit visible for MoveInLineOfSight
//virtual bool IsVisible(Unit *) const { return false; }
+ // called when the corpse of this creature gets removed
+ virtual void CorpseRemoved(uint32 & /*respawnDelay*/) {}
+
// Called when victim entered water and creature can not enter water
//virtual bool canReachByRangeAttack(Unit*) { return false; }
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index e2c9b875c7c..de731b5c5b5 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -449,6 +449,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
m_baseSpellPower = 0;
m_baseFeralAP = 0;
m_baseManaRegen = 0;
+ m_armorPenetrationPct = 0.0f;
// Honor System
m_lastHonorUpdateTime = time(NULL);
@@ -5287,7 +5288,7 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
break;
case CR_ARMOR_PENETRATION:
if(affectStats)
- UpdateArmorPenetration(amount);
+ UpdateArmorPenetration();
break;
}
}
@@ -7083,6 +7084,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)
@@ -11043,9 +11051,15 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update )
// update expertise and armor penetration - passive auras may need it
if( slot == EQUIPMENT_SLOT_MAINHAND )
+ {
UpdateExpertise(BASE_ATTACK);
+ UpdateArmorPenetration();
+ }
else if( slot == EQUIPMENT_SLOT_OFFHAND )
+ {
UpdateExpertise(OFF_ATTACK);
+ UpdateArmorPenetration();
+ }
switch(slot)
{
@@ -11195,6 +11209,7 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update )
}
UpdateExpertise(BASE_ATTACK);
+ UpdateArmorPenetration();
}
else if( slot == EQUIPMENT_SLOT_OFFHAND )
UpdateExpertise(OFF_ATTACK);
@@ -11204,7 +11219,7 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update )
case EQUIPMENT_SLOT_MAINHAND:
case EQUIPMENT_SLOT_OFFHAND:
case EQUIPMENT_SLOT_RANGED:
- RecalculateRating(CR_ARMOR_PENETRATION);
+ UpdateArmorPenetration();
default:
break;
}
@@ -11321,15 +11336,21 @@ void Player::DestroyItem( uint8 bag, uint8 slot, bool update )
case EQUIPMENT_SLOT_MAINHAND:
case EQUIPMENT_SLOT_OFFHAND:
case EQUIPMENT_SLOT_RANGED:
- RecalculateRating(CR_ARMOR_PENETRATION);
+ UpdateArmorPenetration();
default:
break;
}
- if ( slot == EQUIPMENT_SLOT_MAINHAND )
+ if( slot == EQUIPMENT_SLOT_MAINHAND )
+ {
UpdateExpertise(BASE_ATTACK);
+ UpdateArmorPenetration();
+ }
else if( slot == EQUIPMENT_SLOT_OFFHAND )
+ {
UpdateExpertise(OFF_ATTACK);
+ UpdateArmorPenetration();
+ }
// equipment visual show
SetVisibleItemSlot(slot, NULL);
@@ -13216,9 +13237,7 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
}
}
- //if( qInfo->HasSpecialFlag( QUEST_FLAGS_TIMED ) )
- // SetTimedQuest( 0 );
- m_timedquests.erase(pQuest->GetQuestId());
+ RemoveTimedQuest(quest_id);
if (pQuest->GetRewChoiceItemsCount() > 0)
{
@@ -13430,6 +13449,7 @@ void Player::FailQuest(uint32 questId)
{
QuestStatusData& q_status = mQuestStatus[questId];
+ RemoveTimedQuest(questId);
q_status.m_timer = 0;
SendQuestTimerFailed(questId);
@@ -13655,12 +13675,12 @@ 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_TRINITY_FLAGS_TIMED) )
+ if (m_timedquests.empty() && qInfo->HasFlag(QUEST_TRINITY_FLAGS_TIMED))
{
- if( msg )
- SendCanTakeQuestResponse( INVALIDREASON_QUEST_ONLY_ONE_TIMED );
+ if (msg)
+ SendCanTakeQuestResponse(INVALIDREASON_QUEST_ONLY_ONE_TIMED);
return false;
}
return true;
@@ -13888,12 +13908,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_TRINITY_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 44db36d30c4..66c92074509 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -1315,6 +1315,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 ***/
@@ -1700,7 +1701,7 @@ class MANGOS_DLL_SPEC Player : public Unit
void UpdateAllSpellCritChances();
void UpdateSpellCritChance(uint32 school);
- void UpdateArmorPenetration(int32 amount);
+ void UpdateArmorPenetration();
void UpdateExpertise(WeaponAttackType attType);
void ApplyManaRegenBonus(int32 amount, bool apply);
void UpdateManaRegen();
@@ -1869,6 +1870,7 @@ class MANGOS_DLL_SPEC Player : public Unit
float GetTotalPercentageModValue(BaseModGroup modGroup) const { return m_auraBaseMod[modGroup][FLAT_MOD] + m_auraBaseMod[modGroup][PCT_MOD]; }
void _ApplyAllStatBonuses();
void _RemoveAllStatBonuses();
+ float GetArmorPenetrationPct() const { return m_armorPenetrationPct; }
void _ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply);
void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, AuraEffect* aura, bool apply);
@@ -2252,7 +2254,8 @@ Spell * m_spellModTakingSpell;
/*********************************************************/
/*** QUEST SYSTEM ***/
/*********************************************************/
-
+
+ //We allow only one timed quest active at the same time. Below can then be simple value instead of set.
std::set<uint32> m_timedquests;
uint64 m_divider;
@@ -2362,6 +2365,7 @@ Spell * m_spellModTakingSpell;
uint16 m_baseSpellPower;
uint16 m_baseFeralAP;
uint16 m_baseManaRegen;
+ float m_armorPenetrationPct;
SpellModList m_spellMods[MAX_SPELLMOD];
uint32 m_pad;
diff --git a/src/game/QuestHandler.cpp b/src/game/QuestHandler.cpp
index 3e9cca09ddb..a803c49d6fd 100644
--- a/src/game/QuestHandler.cpp
+++ b/src/game/QuestHandler.cpp
@@ -354,6 +354,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_TRINITY_FLAGS_TIMED))
+ _player->RemoveTimedQuest(quest);
+ }
+
_player->TakeQuestSourceItem(quest, true); // remove quest src item from player
_player->SetQuestStatus( quest, QUEST_STATUS_NONE);
}
diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index 139de37bf84..0ccab173166 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -1969,7 +1969,7 @@ enum HolidayIds
HOLIDAY_NOBLEGARDEN = 181,
HOLIDAY_CHILDRENS_WEEK = 201,
HOLIDAY_CALL_TO_ARMS_AV = 283,
- HOLIDAY_CALL_TO_ARMS_WG = 284,
+ HOLIDAY_CALL_TO_ARMS_WS = 284,
HOLIDAY_CALL_TO_ARMS_AB = 285,
HOLIDAY_FISHING_EXTRAVAGANZA = 301,
HOLIDAY_HARVEST_FESTIVAL = 321,
@@ -1977,7 +1977,7 @@ enum HolidayIds
HOLIDAY_LUNAR_FESTIVAL = 327,
HOLIDAY_LOVE_IS_IN_THE_AIR = 335,
HOLIDAY_FIRE_FESTIVAL = 341,
- HOLIDAY_CALL_TO_ARMS_ES = 353,
+ HOLIDAY_CALL_TO_ARMS_EY = 353,
HOLIDAY_BREWFEST = 372,
HOLIDAY_DARKMOON_FAIRE_ELWYNN = 374,
HOLIDAY_DARKMOON_FAIRE_THUNDER = 375,
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 31348dedda9..5301eb4069b 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -5493,10 +5493,14 @@ SpellCastResult Spell::CheckPower()
sLog.outError("Spell::CheckPower: Unknown power type '%d'", m_spellInfo->powerType);
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/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h
index ffcbdacda34..866182f9733 100644
--- a/src/game/SpellAuraDefines.h
+++ b/src/game/SpellAuraDefines.h
@@ -325,7 +325,7 @@ enum AuraType
SPELL_AURA_MOD_MAX_AFFECTED_TARGETS = 277,
SPELL_AURA_MOD_DISARM_RANGED = 278,
SPELL_AURA_INITIALIZE_IMAGES = 279,
- SPELL_AURA_MOD_ARMOR_PENETRATION_PCT = 280,
+ SPELL_AURA_MOD_TARGET_ARMOR_PCT = 280,
SPELL_AURA_MOD_HONOR_GAIN_PCT = 281,
SPELL_AURA_MOD_BASE_HEALTH_PCT = 282,
SPELL_AURA_MOD_HEALING_RECEIVED = 283, // Possibly only for some spell family class spells
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index c1723bf9936..6454a1c2655 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -333,7 +333,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleNoImmediateEffect, //277 SPELL_AURA_MOD_ABILITY_AFFECTED_TARGETS implemented in spell::settargetmap
&Aura::HandleAuraModDisarm, //278 SPELL_AURA_MOD_DISARM_RANGED disarm ranged weapon
&Aura::HandleAuraInitializeImages, //279 SPELL_AURA_INITIALIZE_IMAGES
- &Aura::HandleNoImmediateEffect, //280 SPELL_AURA_MOD_TARGET_ARMOR_PCT implemented in Unit::CalcArmorReducedDamage
+ &Aura::HandleModTargetArmorPct, //280 SPELL_AURA_MOD_TARGET_ARMOR_PCT
&Aura::HandleNoImmediateEffect, //281 SPELL_AURA_MOD_HONOR_GAIN_PCT implemented in Player::RewardHonor
&Aura::HandleAuraIncreaseBaseHealthPercent, //282 SPELL_AURA_INCREASE_BASE_HEALTH_PERCENT
&Aura::HandleNoImmediateEffect, //283 SPELL_AURA_MOD_HEALING_RECEIVED implemented in Unit::SpellHealingBonus
@@ -747,7 +747,7 @@ void AreaAuraEffect::Update(uint32 diff)
case AREA_AURA_PET:
{
if(Unit *owner = caster->GetCharmerOrOwner())
- if (owner->IsWithinDistInMap(source, m_radius))
+ if (caster->IsWithinDistInMap(owner, m_radius))
targets.push_back(owner);
break;
}
@@ -6919,6 +6919,7 @@ void AuraEffect::HandleAuraCloneCaster( bool Apply, bool Real , bool /*changeAmo
void AuraEffect::HandleAuraModCritPct(bool apply, bool Real, bool changeAmount)
{
+ /*
if(m_target->GetTypeId() != TYPEID_PLAYER)
{
m_target->m_baseSpellCritChance += apply ? m_amount:-m_amount;
@@ -6931,6 +6932,20 @@ void AuraEffect::HandleAuraModCritPct(bool apply, bool Real, bool changeAmount)
((Player*)m_target)->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (m_amount), apply);
((Player*)m_target)->HandleBaseModValue(OFFHAND_CRIT_PERCENTAGE, FLAT_MOD, float (m_amount), apply);
((Player*)m_target)->HandleBaseModValue(RANGED_CRIT_PERCENTAGE, FLAT_MOD, float (m_amount), apply);
+ */
+ // spells required only Real aura add/remove
+ if(!Real)
+ return;
+
+ if(m_target->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ ((Player*)m_target)->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (m_amount), apply);
+ ((Player*)m_target)->HandleBaseModValue(OFFHAND_CRIT_PERCENTAGE, FLAT_MOD, float (m_amount), apply);
+ ((Player*)m_target)->HandleBaseModValue(RANGED_CRIT_PERCENTAGE, FLAT_MOD, float (m_amount), apply);
+
+ // included in Player::UpdateSpellCritChance calculation
+ ((Player*)m_target)->UpdateAllSpellCritChances();
}
void AuraEffect::HandleAuraLinked(bool apply, bool Real, bool /*changeAmount*/)
@@ -6999,3 +7014,11 @@ bool AuraEffect::IsPeriodicTickCrit(Unit const * pCaster) const
return false;
}
+void AuraEffect::HandleModTargetArmorPct(bool apply, bool Real, bool changeAmount)
+{
+ if(m_target->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ ((Player*)m_target)->UpdateArmorPenetration();
+}
+
diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
index 821e208d6b7..fe82a319f20 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -333,6 +333,7 @@ class TRINITY_DLL_SPEC AuraEffect
void HandleAuraCloneCaster(bool Apply, bool Real, bool changeAmount);
void HandleAuraModCritPct(bool Apply, bool Real, bool changeAmount);
void HandleAuraLinked(bool Apply, bool Real, bool changeAmount);
+ void HandleModTargetArmorPct(bool Apply, bool Real, bool changeAmount);
void HandleAuraEffectSpecificMods(bool apply, bool Real, bool changeAmount);
int32 CalculateCrowdControlAuraAmount(Unit * caster);
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 5665121dbff..56679b1abe4 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -371,7 +371,8 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
aur->SetStackAmount(count);
}
}
- else if(unitTarget->HasAura(m_triggeredByAuraSpell->Id))
+
+ if(unitTarget->HasAura(m_triggeredByAuraSpell->Id))
damage = 0;
break;
// Consumption
@@ -409,8 +410,16 @@ void Spell::SpellDamageSchoolDmg(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/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index ff8a1d02f29..c1b78ebc7ab 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -761,6 +761,8 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con
case 31719: // Suspension
case 61987: // Avenging Wrath Marker
case 50524: // Runic Power Feed
+ case 52671: // Arcing Burn
+ case 59834: // Arcing Burn
return false;
case 12042: // Arcane Power
return true;
diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp
index 56bde0e5442..b662769b77f 100644
--- a/src/game/StatSystem.cpp
+++ b/src/game/StatSystem.cpp
@@ -151,6 +151,7 @@ bool Player::UpdateAllStats()
UpdateAllSpellCritChances();
UpdateDefenseBonusesMod();
UpdateShieldBlockValue();
+ UpdateArmorPenetration();
UpdateSpellDamageAndHealingBonus();
UpdateManaRegen();
UpdateExpertise(BASE_ATTACK);
@@ -625,13 +626,13 @@ void Player::UpdateSpellCritChance(uint32 school)
// Store crit value
SetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1 + school, crit);
}
-
+/*
void Player::UpdateArmorPenetration(int32 amount)
{
// Store Rating Value
SetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_ARMOR_PENETRATION, amount);
}
-
+*/
void Player::UpdateMeleeHitChances()
{
m_modMeleeHitChance = GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE);
@@ -687,6 +688,33 @@ void Player::UpdateExpertise(WeaponAttackType attack)
}
}
+void Player::UpdateArmorPenetration()
+{
+ m_armorPenetrationPct = GetRatingBonusValue(CR_ARMOR_PENETRATION);
+
+ AuraEffectList const& armorAuras = GetAurasByType(SPELL_AURA_MOD_TARGET_ARMOR_PCT);
+ for(AuraEffectList::const_iterator itr = armorAuras.begin(); itr != armorAuras.end(); ++itr)
+ {
+ // affects all weapons
+ if((*itr)->GetSpellProto()->EquippedItemClass == -1)
+ {
+ m_armorPenetrationPct += (*itr)->GetAmount();
+ continue;
+ }
+
+ // dependent on weapon class
+ for(uint8 i = 0; i < MAX_ATTACK; ++i)
+ {
+ Item *weapon = GetWeaponForAttack(WeaponAttackType(i));
+ if(weapon && weapon->IsFitToSpellRequirements((*itr)->GetSpellProto()))
+ {
+ m_armorPenetrationPct += (*itr)->GetAmount();
+ break;
+ }
+ }
+ }
+}
+
void Player::ApplyManaRegenBonus(int32 amount, bool apply)
{
m_baseManaRegen+= apply ? amount : -amount;
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 02ad5bb69cb..0364ead6776 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -1653,7 +1653,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellEnt
if ( GetTypeId() == TYPEID_PLAYER )
{
- AuraEffectList const& ResIgnoreAuras = GetAurasByType(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT);
+ AuraEffectList const& ResIgnoreAuras = GetAurasByType(SPELL_AURA_MOD_TARGET_ARMOR_PCT);
for(AuraEffectList::const_iterator itr = ResIgnoreAuras.begin();itr != ResIgnoreAuras.end(); ++itr)
{
// item neutral spell
@@ -1694,7 +1694,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellEnt
}
// Ignore enemy armor by SPELL_AURA_MOD_TARGET_ARMOR_PCT
- //armor *= 1.0f - GetTotalAuraModifier(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT) / 100.0f;
+ armor *= 1.0f - ((Player*)this)->GetArmorPenetrationPct() / 100.0f;
if (armor < 0.0f)
armor = 0.0f;