diff options
14 files changed, 56 insertions, 95 deletions
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 797e615dede..387ce88b2ae 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -188,7 +188,6 @@ Battleground::Battleground() m_TeamScores[BG_TEAM_HORDE] = 0; m_PrematureCountDown = false; - m_PrematureCountDown = 0; m_HonorMode = BG_NORMAL; diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index c8426edf6ab..952634a8c67 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -911,19 +911,15 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target) if (!trapSpell) // checked at load already return; + /*** FIXME: this maybe not correct ***/ float range; SpellRangeEntry const * srentry = sSpellRangeStore.LookupEntry(trapSpell->rangeIndex); //get owner to check hostility of GameObject - if (GetSpellMaxRangeForHostile(srentry) == GetSpellMaxRangeForHostile(srentry)) - range = GetSpellMaxRangeForHostile(srentry); + if (Unit *owner = GetOwner()) + range = (float)owner->GetSpellMaxRangeForTarget(target, srentry); else - { - if (Unit *owner = GetOwner()) - range = (float)owner->GetSpellMaxRangeForTarget(target, srentry); - else - //if no owner assume that object is hostile to target - range = GetSpellMaxRangeForHostile(srentry); - } + //if no owner assume that object is hostile to target + range = GetSpellMaxRangeForHostile(srentry); // search nearest linked GO GameObject* trapGO = NULL; @@ -1509,15 +1505,15 @@ void GameObject::Use(Unit* user) { case 179785: // Silverwing Flag // check if it's correct bg - if (bg->GetTypeID(true) == BATTLEGROUND_WS) + if (bg->IsRandom() ? bg->GetTypeID(true) : bg->GetTypeID(false) == BATTLEGROUND_WS) bg->EventPlayerClickedOnFlag(player, this); break; case 179786: // Warsong Flag - if (bg->GetTypeID(true) == BATTLEGROUND_WS) + if (bg->IsRandom() ? bg->GetTypeID(true) : bg->GetTypeID(false) == BATTLEGROUND_WS) bg->EventPlayerClickedOnFlag(player, this); break; case 184142: // Netherstorm Flag - if (bg->GetTypeID(true) == BATTLEGROUND_EY) + if (bg->IsRandom() ? bg->GetTypeID(true) : bg->GetTypeID(false) == BATTLEGROUND_EY) bg->EventPlayerClickedOnFlag(player, this); break; } diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 1ce86567d17..7d1dce86b5a 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -471,7 +471,6 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids) // sLog.outDetail(" Generated %lu waypoints, total time %u.", (unsigned long)m_WayPoints.size(), timer); m_curr = m_WayPoints.begin(); - m_curr = GetNextWayPoint(); m_next = GetNextWayPoint(); m_pathTime = timer; diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp index 4c3467e0ab6..9cb130cb8b1 100755 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp @@ -26,8 +26,7 @@ IdleMovementGenerator si_idleMovement; // But it should not be sent otherwise there are many redundent packets void IdleMovementGenerator::Initialize(Unit &owner) { - if (owner.hasUnitState(UNIT_STAT_MOVE)) - owner.StopMoving(); + Reset(owner); } void diff --git a/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp index f14a8663c38..c956a7deaee 100755 --- a/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp @@ -283,13 +283,8 @@ void WorldSession::HandleChannelAnnouncements(WorldPacket& recvPacket) void WorldSession::HandleChannelDisplayListQuery(WorldPacket &recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); - std::string channelname; - recvPacket >> channelname; - if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) - if (Channel *chn = cMgr->GetChannel(channelname, _player)) - chn->List(_player); + // this should be OK because the 2 function _were_ the same + HandleChannelList(recvPacket); } void WorldSession::HandleGetChannelMemberCount(WorldPacket &recvPacket) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index dca970edf95..06b065eb78d 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4223,14 +4223,9 @@ void AuraEffect::HandleAuraModIncreaseSpeed(AuraApplication const * aurApp, uint target->UpdateSpeed(MOVE_RUN, true); } -void AuraEffect::HandleAuraModIncreaseMountedSpeed(AuraApplication const * aurApp, uint8 mode, bool /*apply*/) const +void AuraEffect::HandleAuraModIncreaseMountedSpeed(AuraApplication const * aurApp, uint8 mode, bool apply) const { - if (!(mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK)) - return; - - Unit * target = aurApp->GetTarget(); - - target->UpdateSpeed(MOVE_RUN, true); + HandleAuraModIncreaseSpeed(aurApp, mode, apply); } void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const * aurApp, uint8 mode, bool apply) const @@ -4868,20 +4863,9 @@ void AuraEffect::HandleModPowerRegen(AuraApplication const * aurApp, uint8 mode, // other powers are not immediate effects - implemented in Player::Regenerate, Creature::Regenerate } -void AuraEffect::HandleModPowerRegenPCT(AuraApplication const * aurApp, uint8 mode, bool /*apply*/) const +void AuraEffect::HandleModPowerRegenPCT(AuraApplication const * aurApp, uint8 mode, bool apply) const { - if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT))) - return; - - Unit * target = aurApp->GetTarget(); - - if (target->GetTypeId() != TYPEID_PLAYER) - return; - - // Update manaregen value - if (GetMiscValue() == POWER_MANA) - target->ToPlayer()->UpdateManaRegen(); - // other powers are not immediate effects - implemented in Player::Regenerate, Creature::Regenerate + HandleModPowerRegen(aurApp, mode, apply); } void AuraEffect::HandleModManaRegen(AuraApplication const * aurApp, uint8 mode, bool /*apply*/) const @@ -5055,17 +5039,9 @@ void AuraEffect::HandleAuraModBlockPercent(AuraApplication const * aurApp, uint8 target->ToPlayer()->UpdateBlockPercentage(); } -void AuraEffect::HandleAuraModRegenInterrupt(AuraApplication const * aurApp, uint8 mode, bool /*apply*/) const +void AuraEffect::HandleAuraModRegenInterrupt(AuraApplication const * aurApp, uint8 mode, bool apply) const { - if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT))) - return; - - Unit * target = aurApp->GetTarget(); - - if (target->GetTypeId() != TYPEID_PLAYER) - return; - - target->ToPlayer()->UpdateManaRegen(); + HandleModManaRegen(aurApp, mode, apply); } void AuraEffect::HandleAuraModWeaponCritPercent(AuraApplication const * aurApp, uint8 mode, bool apply) const @@ -5362,16 +5338,9 @@ void AuraEffect::HandleAuraModRangedAttackPowerOfStatPercent(AuraApplication con target->ToPlayer()->UpdateAttackPowerAndDamage(true); } -void AuraEffect::HandleAuraModAttackPowerOfStatPercent(AuraApplication const * aurApp, uint8 mode, bool /*apply*/) const +void AuraEffect::HandleAuraModAttackPowerOfStatPercent(AuraApplication const * aurApp, uint8 mode, bool apply) const { - if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT))) - return; - - Unit * target = aurApp->GetTarget(); - - // Recalculate bonus - if (target->GetTypeId() == TYPEID_PLAYER) - target->ToPlayer()->UpdateAttackPowerAndDamage(false); + HandleAuraModAttackPowerOfArmor(aurApp, mode, apply); } void AuraEffect::HandleAuraModAttackPowerOfArmor(AuraApplication const * aurApp, uint8 mode, bool /*apply*/) const diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 8f4bf73c1a3..c5d9179f78a 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3228,10 +3228,10 @@ void Spell::EffectDualWield(SpellEffIndex /*effIndex*/) unitTarget->ToCreature()->UpdateDamagePhysical(OFF_ATTACK); } -void Spell::EffectPull(SpellEffIndex /*effIndex*/) +void Spell::EffectPull(SpellEffIndex effIndex) { // TODO: create a proper pull towards distract spell center for distract - sLog.outDebug("WORLD: Spell Effect DUMMY"); + EffectNULL(effIndex); } void Spell::EffectDistract(SpellEffIndex /*effIndex*/) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp index 94a66b20c95..d0ebb877ebc 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp @@ -184,7 +184,7 @@ public: void Reset() { - summons.DespawnAll(); + DespawnAllImp(); } void JustSummoned(Creature* summon) diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp index a488ae8389e..6519478a26d 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -125,8 +125,10 @@ public: DrainLifeTimer = 3000 + rand()%4000; DrainManaTimer = DrainLifeTimer + 5000; FelExplosionTimer = 2100; - DrainCrystalTimer = 10000 + rand()%5000; - DrainCrystalTimer = 20000 + rand()%5000; + if (IsHeroic()) + DrainCrystalTimer = 10000 + rand()%5000; + else + DrainCrystalTimer = 20000 + rand()%5000; EmpowerTimer = 10000; IsDraining = false; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp index e75bbcfea4c..4dac6110ed4 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp @@ -104,17 +104,17 @@ public: ai->Reset(); ai->EnterEvadeMode(); - ai->Spell[0].SpellId = SPELL_BLIZZARD; - ai->Spell[0].Cooldown = 15000 + rand()%20000; - ai->Spell[0].TargetType = TARGETTYPE_RANDOM; + ai->Spells[0].SpellId = SPELL_BLIZZARD; + ai->Spells[0].Cooldown = 15000 + rand()%20000; + ai->Spells[0].TargetType = TARGETTYPE_RANDOM; - ai->Spell[1].SpellId = SPELL_PYROBLAST; - ai->Spell[1].Cooldown = 5500 + rand()%4000; - ai->Spell[1].TargetType = TARGETTYPE_RANDOM; + ai->Spells[1].SpellId = SPELL_PYROBLAST; + ai->Spells[1].Cooldown = 5500 + rand()%4000; + ai->Spells[1].TargetType = TARGETTYPE_RANDOM; - ai->Spell[2].SpellId = SPELL_SUMMON_ELEMENTALS; - ai->Spell[2].Cooldown = 15000 + rand()%30000; - ai->Spell[2].TargetType = TARGETTYPE_SELF; + ai->Spells[2].SpellId = SPELL_SUMMON_ELEMENTALS; + ai->Spells[2].Cooldown = 15000 + rand()%30000; + ai->Spells[2].TargetType = TARGETTYPE_SELF; return ai; } @@ -188,13 +188,13 @@ public: ai->Reset(); ai->EnterEvadeMode(); - ai->Spell[0].SpellId = SPELL_CHAIN_LIGHTNING; - ai->Spell[0].Cooldown = 3000 + rand()%5000; - ai->Spell[0].TargetType = TARGETTYPE_VICTIM; + ai->Spells[0].SpellId = SPELL_CHAIN_LIGHTNING; + ai->Spells[0].Cooldown = 3000 + rand()%5000; + ai->Spells[0].TargetType = TARGETTYPE_VICTIM; - ai->Spell[1].SpellId = SPELL_SUMMON_DIRE_WOLF; - ai->Spell[1].Cooldown = 6000 + rand()%35000; - ai->Spell[1].TargetType = TARGETTYPE_RANDOM; + ai->Spells[1].SpellId = SPELL_SUMMON_DIRE_WOLF; + ai->Spells[1].Cooldown = 6000 + rand()%35000; + ai->Spells[1].TargetType = TARGETTYPE_RANDOM; return ai; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 4c41e2d11e7..a8e558621da 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -389,7 +389,7 @@ void hyjalAI::Reset() me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); //Initialize spells - memset(Spell, 0, sizeof(Spell)); + memset(Spells, 0, sizeof(Spell) * HYJAL_AI_MAX_SPELLS); //Reset Instance Data for trash count if (pInstance) @@ -425,9 +425,9 @@ void hyjalAI::EnterEvadeMode() void hyjalAI::EnterCombat(Unit * /*who*/) { if (IsDummy)return; - for (uint8 i = 0; i < 3; ++i) - if (Spell[i].Cooldown) - SpellTimer[i] = Spell[i].Cooldown; + for (uint8 i = 0; i < HYJAL_AI_MAX_SPELLS; ++i) + if (Spells[i].Cooldown) + SpellTimer[i] = Spells[i].Cooldown; Talk(ATTACKED); } @@ -881,9 +881,9 @@ void hyjalAI::UpdateAI(const uint32 diff) if (!UpdateVictim()) return; - for (uint8 i = 0; i < 3; ++i) + for (uint8 i = 0; i < HYJAL_AI_MAX_SPELLS; ++i) { - if (Spell[i].SpellId) + if (Spells[i].SpellId) { if (SpellTimer[i] <= diff) { @@ -892,7 +892,7 @@ void hyjalAI::UpdateAI(const uint32 diff) Unit *pTarget = NULL; - switch(Spell[i].TargetType) + switch(Spells[i].TargetType) { case TARGETTYPE_SELF: pTarget = me; break; case TARGETTYPE_RANDOM: pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); break; @@ -901,8 +901,8 @@ void hyjalAI::UpdateAI(const uint32 diff) if (pTarget && pTarget->isAlive()) { - DoCast(pTarget, Spell[i].SpellId); - SpellTimer[i] = Spell[i].Cooldown; + DoCast(pTarget, Spells[i].SpellId); + SpellTimer[i] = Spells[i].Cooldown; } } else SpellTimer[i] -= diff; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h index d9334cc3a18..1126f62ede8 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h @@ -22,6 +22,8 @@ #include "hyjal.h" #include "ScriptedEscortAI.h" +#define HYJAL_AI_MAX_SPELLS 3 + // Trash Mobs summoned in waves #define NECROMANCER 17899//done #define ABOMINATION 17898//done @@ -252,7 +254,7 @@ struct hyjalAI : public npc_escortAI uint32 SpellId; uint32 Cooldown; uint32 TargetType; - }Spell[3]; + } Spells[HYJAL_AI_MAX_SPELLS]; private: uint32 SpellTimer[3]; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp index 309f4b91019..57125052da8 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp @@ -79,8 +79,8 @@ public: case 0: RandX = 0.0f - Rand; break; case 1: RandX = 0.0f + Rand; break; } - Rand = 0; - Rand = 10 + (rand()%10); + + Rand = 10 + (rand()%10); switch (rand()%2) { case 0: RandY = 0.0f - Rand; break; diff --git a/src/server/scripts/Northrend/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ObsidianSanctum/boss_sartharion.cpp index f3e8d892f04..b10a8bfee78 100644 --- a/src/server/scripts/Northrend/ObsidianSanctum/boss_sartharion.cpp +++ b/src/server/scripts/Northrend/ObsidianSanctum/boss_sartharion.cpp @@ -1194,7 +1194,7 @@ public: m_uiShadowBreathTimer -= uiDiff; // Don't attack current target if he's not visible for us. - if(me->getVictim() && me->getVictim() && me->getVictim()->HasAura(57874, 0)) + if(me->getVictim() && me->getVictim()->HasAura(57874, 0)) me->getThreatManager().modifyThreatPercent(me->getVictim(), -100); DoMeleeAttackIfReady(); |