Merge branch '3.3.5' into 4.3.4

Conflicts:
	sql/updates/world/2015_07_29_00_world.sql
	sql/updates/world/2015_07_29_01_world.sql
	sql/updates/world/2015_08_01_00_world.sql
	src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Player/Player.h
	src/server/game/Server/Protocol/Opcodes.cpp
	src/server/game/Spells/SpellEffects.cpp
	src/server/game/Spells/SpellMgr.cpp
	src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
	src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
	src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp
	src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp
	src/server/scripts/Spells/spell_hunter.cpp
	src/server/scripts/Spells/spell_pet.cpp
This commit is contained in:
Carbenium committed 2015-08-12 21:05:39 +02:00
commit 99ab531e76
14 files changed
+174 -90

No files matched your search

+20 -20
View File
@@ -333,7 +333,7 @@ void Unit::Update(uint32 p_time)
SendThreatListUpdate();
// update combat timer only for players and pets (only pets with PetAI)
if (IsInCombat() && (GetTypeId() == TYPEID_PLAYER || (ToCreature()->IsPet() && IsControlledByPlayer())))
if (IsInCombat() && (GetTypeId() == TYPEID_PLAYER || (IsPet() && IsControlledByPlayer())))
{
// Check UNIT_STATE_MELEE_ATTACKING or UNIT_STATE_CHASE (without UNIT_STATE_FOLLOW in this case) so pets can reach far away
// targets without stopping half way there and running off.
@@ -2029,8 +2029,8 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
// Max 40% chance to score a glancing blow against mobs that are higher level (can do only players and pets and not with ranged weapon)
if (attType != RANGED_ATTACK &&
(GetTypeId() == TYPEID_PLAYER || ToCreature()->IsPet()) &&
victim->GetTypeId() != TYPEID_PLAYER && !victim->ToCreature()->IsPet() &&
(GetTypeId() == TYPEID_PLAYER || IsPet()) &&
victim->GetTypeId() != TYPEID_PLAYER && !victim->IsPet() &&
getLevel() < victim->getLevelForTarget(this))
{
// cap possible value (with bonuses > max skill)
@@ -2531,7 +2531,7 @@ float Unit::GetUnitDodgeChance() const
return GetFloatValue(PLAYER_DODGE_PERCENTAGE);
else
{
if (ToCreature()->IsTotem())
if (IsTotem())
return 0.0f;
else
{
@@ -2603,7 +2603,7 @@ float Unit::GetUnitBlockChance() const
}
else
{
if (ToCreature()->IsTotem())
if (IsTotem())
return 0.0f;
else
{
@@ -3258,7 +3258,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo
ASSERT(!aurApp->GetEffectMask());
// Remove totem at next update if totem loses its aura
if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE && GetTypeId() == TYPEID_UNIT && ToCreature()->IsTotem())
if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE && GetTypeId() == TYPEID_UNIT && IsTotem())
{
if (ToTotem()->GetSpell() == aura->GetId() && ToTotem()->GetTotemType() == TOTEM_PASSIVE)
ToTotem()->setDeathState(JUST_DIED);
@@ -7558,7 +7558,7 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
//if (GetTypeId() == TYPEID_UNIT)
// ToCreature()->SetCombatStartPosition(GetPositionX(), GetPositionY(), GetPositionZ());
if (GetTypeId() == TYPEID_UNIT && !ToCreature()->IsPet())
if (GetTypeId() == TYPEID_UNIT && !IsPet())
{
// should not let player enter combat by right clicking target - doesn't helps
SetInCombatWith(victim);
@@ -8047,7 +8047,7 @@ void Unit::GetAllMinionsByEntry(std::list<Creature*>& Minions, uint32 entry)
Unit* unit = *itr;
++itr;
if (unit->GetEntry() == entry && unit->GetTypeId() == TYPEID_UNIT
&& unit->ToCreature()->IsSummon()) // minion, actually
&& unit->IsSummon()) // minion, actually
Minions.push_back(unit->ToCreature());
}
}
@@ -8059,7 +8059,7 @@ void Unit::RemoveAllMinionsByEntry(uint32 entry)
Unit* unit = *itr;
++itr;
if (unit->GetEntry() == entry && unit->GetTypeId() == TYPEID_UNIT
&& unit->ToCreature()->IsSummon()) // minion, actually
&& unit->IsSummon()) // minion, actually
unit->ToTempSummon()->UnSummon();
// i think this is safe because i have never heard that a despawned minion will trigger a same minion
}
@@ -8153,7 +8153,7 @@ int32 Unit::DealHeal(Unit* victim, uint32 addhealth)
Unit* unit = this;
if (GetTypeId() == TYPEID_UNIT && ToCreature()->IsTotem())
if (GetTypeId() == TYPEID_UNIT && IsTotem())
unit = GetOwner();
if (Player* player = unit->ToPlayer())
@@ -8205,7 +8205,7 @@ Unit* Unit::GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo)
// Set up missile speed based delay
uint32 delay = uint32(std::floor(std::max<float>(victim->GetDistance(this), 5.0f) / spellInfo->Speed * 1000.0f));
// Schedule charge drop
(*itr)->GetBase()->DropChargeDelayed(delay,AURA_REMOVE_BY_EXPIRE);
(*itr)->GetBase()->DropChargeDelayed(delay, AURA_REMOVE_BY_EXPIRE);
}
else
(*itr)->GetBase()->DropCharge(AURA_REMOVE_BY_EXPIRE);
@@ -8294,7 +8294,7 @@ Unit* Unit::GetNextRandomRaidMemberOrPet(float radius)
if (GetTypeId() == TYPEID_PLAYER)
player = ToPlayer();
// Should we enable this also for charmed units?
else if (GetTypeId() == TYPEID_UNIT && ToCreature()->IsPet())
else if (GetTypeId() == TYPEID_UNIT && IsPet())
player = GetOwner()->ToPlayer();
if (!player)
@@ -8444,7 +8444,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
return pdamage;
// For totems get damage bonus from owner
if (GetTypeId() == TYPEID_UNIT && ToCreature()->IsTotem())
if (GetTypeId() == TYPEID_UNIT && IsTotem())
if (Unit* owner = GetOwner())
return owner->SpellDamageBonusDone(victim, spellProto, pdamage, damagetype);
@@ -8575,14 +8575,14 @@ float Unit::SpellDamagePctDone(Unit* victim, SpellInfo const* spellProto, Damage
return 1.0f;
// For totems pct done mods are calculated when its calculation is run on the player in SpellDamageBonusDone.
if (GetTypeId() == TYPEID_UNIT && ToCreature()->IsTotem())
if (GetTypeId() == TYPEID_UNIT && IsTotem())
return 1.0f;
// Done total percent damage auras
float DoneTotalMod = 1.0f;
// Pet damage?
if (GetTypeId() == TYPEID_UNIT && !ToCreature()->IsPet())
if (GetTypeId() == TYPEID_UNIT && !IsPet())
DoneTotalMod *= ToCreature()->GetSpellDamageMod(ToCreature()->GetCreatureTemplate()->rank);
AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
@@ -10911,7 +10911,7 @@ bool Unit::CanHaveThreatList(bool skipAliveCheck) const
return false;
// totems can not have threat list
if (ToCreature()->IsTotem())
if (IsTotem())
return false;
// vehicles can not have threat list
@@ -12893,7 +12893,7 @@ Player* Unit::GetSpellModOwner() const
if (Player* player = const_cast<Unit*>(this)->ToPlayer())
return player;
if (ToCreature()->IsPet() || ToCreature()->IsTotem())
if (IsPet() || IsTotem())
{
if (Unit* owner = GetOwner())
if (Player* player = owner->ToPlayer())
@@ -13179,7 +13179,7 @@ void Unit::ApplyCastTimePercentMod(float val, bool apply)
uint32 Unit::GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const
{
// Not apply this to creature cast spells with casttime == 0
if (CastingTime == 0 && GetTypeId() == TYPEID_UNIT && !ToCreature()->IsPet())
if (CastingTime == 0 && GetTypeId() == TYPEID_UNIT && !IsPet())
return 3500;
if (CastingTime > 7000) CastingTime = 7000;
@@ -13279,7 +13279,7 @@ void Unit::UpdateAuraForGroup(uint8 slot)
player->SetAuraUpdateMaskForRaid(slot);
}
}
else if (GetTypeId() == TYPEID_UNIT && ToCreature()->IsPet())
else if (GetTypeId() == TYPEID_UNIT && IsPet())
{
Pet* pet = ((Pet*)this);
if (pet->isControlled())
@@ -14458,7 +14458,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
// a guardian should always have charminfo
if (playerCharmer && this != charmer->GetFirstControlled())
playerCharmer->SendRemoveControlBar();
else if (GetTypeId() == TYPEID_PLAYER || (GetTypeId() == TYPEID_UNIT && !ToCreature()->IsGuardian()))
else if (GetTypeId() == TYPEID_PLAYER || (GetTypeId() == TYPEID_UNIT && !IsGuardian()))
DeleteCharmInfo();
}