Merge branch '3.3.5' into 4.3.4
Conflicts: sql/base/dev/world_database.sql sql/updates/world/2015_07_14_00_world.sql sql/updates/world/2015_07_14_01_world_335.sql sql/updates/world/2015_07_19_00_world_2015_07_18_04.sql sql/updates/world/2015_07_19_05_world.sql sql/updates/world/2015_07_21_00_world.sql sql/updates/world/2015_07_24_00_world.sql sql/updates/world/2015_07_24_01_world.sql sql/updates/world/2015_07_24_02_world.sql sql/updates/world/2015_07_24_03_world.sql sql/updates/world/2015_07_24_04_world.sql sql/updates/world/2015_07_24_05_world.sql sql/updates/world/2015_07_25_03_world.sql sql/updates/world/2015_07_25_04_world.sql src/server/collision/Management/MMapManager.cpp src/server/collision/Management/MMapManager.h src/server/game/Battlefield/Battlefield.h src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Player/Player.h src/server/game/Guilds/Guild.h src/server/game/Server/WorldSession.cpp src/server/game/Server/WorldSocket.cpp src/server/game/Spells/SpellMgr.cpp src/server/game/Weather/WeatherMgr.cpp src/server/scripts/Spells/spell_hunter.cpp src/server/shared/Utilities/Util.cpp
This commit is contained in:
commit
86eb651757
156 files changed
+1402
-967
No files matched your search
@@ -53,8 +53,8 @@
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "Totem.h"
|
||||
#include "Transport.h"
|
||||
#include "Totem.h"
|
||||
#include "UpdateFieldFlags.h"
|
||||
#include "Util.h"
|
||||
#include "Vehicle.h"
|
||||
@@ -291,6 +291,28 @@ Unit::~Unit()
|
||||
ASSERT(m_dynObj.empty());
|
||||
}
|
||||
|
||||
// Check if unit in combat with specific unit
|
||||
bool Unit::IsInCombatWith(Unit const* who) const
|
||||
{
|
||||
// Check target exists
|
||||
if (!who)
|
||||
return false;
|
||||
|
||||
// Search in threat list
|
||||
ObjectGuid guid = who->GetGUID();
|
||||
for (ThreatContainer::StorageType::const_iterator i = m_ThreatManager.getThreatList().begin(); i != m_ThreatManager.getThreatList().end(); ++i)
|
||||
{
|
||||
HostileReference* ref = (*i);
|
||||
|
||||
// Return true if the unit matches
|
||||
if (ref && ref->getUnitGuid() == guid)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Nothing found, false.
|
||||
return false;
|
||||
}
|
||||
|
||||
void Unit::Update(uint32 p_time)
|
||||
{
|
||||
// WARNING! Order of execution here is important, do not change.
|
||||
@@ -7081,7 +7103,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
// Item - Shaman T10 Enhancement 4P Bonus
|
||||
if (AuraEffect const* aurEff = GetAuraEffect(70832, 0))
|
||||
if (Aura const* maelstrom = GetAura(53817))
|
||||
if ((maelstrom->GetStackAmount() == maelstrom->GetSpellInfo()->StackAmount - 1) && roll_chance_i(aurEff->GetAmount()))
|
||||
if ((maelstrom->GetStackAmount() == maelstrom->GetSpellInfo()->StackAmount) && roll_chance_i(aurEff->GetAmount()))
|
||||
CastSpell(this, 70831, true, castItem, triggeredByAura);
|
||||
break;
|
||||
}
|
||||
@@ -8532,15 +8554,11 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
|
||||
DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod);
|
||||
}
|
||||
|
||||
float tmpDamage = float(int32(pdamage) + DoneTotal);
|
||||
// SPELLMOD_DOT will be applied in AuraEffect::HandlePeriodicDamageAurasTick.
|
||||
if (damagetype != DOT)
|
||||
{
|
||||
tmpDamage *= SpellDamagePctDone(victim, spellProto, damagetype);
|
||||
// apply spellmod to Done damage (flat and pct)
|
||||
if (Player* modOwner = GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_DAMAGE, tmpDamage);
|
||||
}
|
||||
// Done Percentage for DOT is already calculated, no need to do it again. The percentage mod is applied in Aura::HandleAuraSpecificMods.
|
||||
float tmpDamage = (int32(pdamage) + DoneTotal) * (damagetype == DOT ? 1.0f : SpellDamagePctDone(victim, spellProto, damagetype));
|
||||
// apply spellmod to Done damage (flat and pct)
|
||||
if (Player* modOwner = GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, tmpDamage);
|
||||
|
||||
return uint32(std::max(tmpDamage, 0.0f));
|
||||
}
|
||||
@@ -9245,15 +9263,11 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
|
||||
DoneTotal = 0;
|
||||
}
|
||||
|
||||
float heal = float(int32(healamount) + DoneTotal);
|
||||
// SPELLMOD_DOT will be applied in AuraEffect::HandlePeriodicHealAurasTick.
|
||||
if (damagetype != DOT)
|
||||
{
|
||||
heal *= SpellHealingPctDone(victim, spellProto);
|
||||
// apply spellmod to Done amount
|
||||
if (Player* modOwner = GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_DAMAGE, heal);
|
||||
}
|
||||
// Done Percentage for DOT is already calculated, no need to do it again. The percentage mod is applied in Aura::HandleAuraSpecificMods.
|
||||
float heal = float(int32(healamount) + DoneTotal) * (damagetype == DOT ? 1.0f : SpellHealingPctDone(victim, spellProto));
|
||||
// apply spellmod to Done amount
|
||||
if (Player* modOwner = GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, heal);
|
||||
|
||||
return uint32(std::max(heal, 0.0f));
|
||||
}
|
||||
@@ -10287,8 +10301,8 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
|
||||
if (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target))
|
||||
return false;
|
||||
|
||||
// can't attack invisible (ignore stealth for aoe spells) also if the area being looked at is from a spell use the dynamic object created instead of the casting unit.
|
||||
if ((!bySpell || !bySpell->HasAttribute(SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && (obj ? !obj->CanSeeOrDetect(target, bySpell && bySpell->IsAffectingArea()) : !CanSeeOrDetect(target, bySpell && bySpell->IsAffectingArea())))
|
||||
// can't attack invisible (ignore stealth for aoe spells) also if the area being looked at is from a spell use the dynamic object created instead of the casting unit. Ignore stealth if target is player and unit in combat with same player
|
||||
if ((!bySpell || !bySpell->HasAttribute(SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && (obj ? !obj->CanSeeOrDetect(target, bySpell && bySpell->IsAffectingArea()) : !CanSeeOrDetect(target, (bySpell && bySpell->IsAffectingArea()) || (target->GetTypeId() == TYPEID_PLAYER && target->HasStealthAura() && target->IsInCombat() && IsInCombatWith(target)))))
|
||||
return false;
|
||||
|
||||
// can't attack dead
|
||||
|
||||
Reference in new issue
Block a user