*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
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
+31
-17
@@ -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;
|
||||
|
||||
+6
-2
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
+8
-4
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
+25
-2
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
+30
-2
@@ -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;
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user